SCENARIO
I have extracted a concern called Taggable. It\'s a module that allows any model to support tagging. I have included
I went with using ActiveRecord Tableless rather than Temping gem, which seems to be a little out of date at the moment.
I set up my test up exactly the same as Stuart M has in his answer but included the has_no_table helper method and columns required in my DummyClass.
class DummyClass < ActiveRecord::Base
# Use ActiveRecord tableless
has_no_table
# Add table columns
column :name, :string
# Add normal ActiveRecord validations etc
validates :name, :presence => true
end
This worked for what I needed to test, which was a module that extended ActiveRecord::Base with a few additional methods, but I haven't tried it with any has_many associations so it still might not help with what you wanted to test.