Skip to content

Commit

Permalink
Fix insert query for postgresql. Move schema definition in schema.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
ProGM committed Feb 20, 2017
1 parent 4757ae5 commit 2011c16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 1 addition & 6 deletions spec/acts_as_taggable_on/caching_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,8 @@

describe 'Cache methods initialization on new models' do
before(:all) do
ActiveRecord::Schema.define do
create_table :cache_methods_injected_models do |t|
t.string :cached_tag_list
end
end
ActiveRecord::Base.connection.execute(
'INSERT INTO cache_methods_injected_models VALUES (NULL, \'ciao\')'
'INSERT INTO cache_methods_injected_models (cached_tag_list) VALUES (\'ciao\')'
)
class CacheMethodsInjectedModel < ActiveRecord::Base
acts_as_taggable
Expand Down
3 changes: 3 additions & 0 deletions spec/internal/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@
t.column :type, :string
end

create_table :cache_methods_injected_models, force: true do |t|
t.column :cached_tag_list, :string
end

# Special cases for postgresql
if using_postgresql?
Expand Down

0 comments on commit 2011c16

Please sign in to comment.