Greetings.
Currently I'm trying to initialize object through has_one association like this:
class Report < ActiveRecord::Base
has_no_table
belongs_to :reportable, polymorphic: true
column :reportable_id, :integer
column :reportable_type, :string
column :period, :daterange, 1.month.ago..Time.current
attr_accessible :smth
end
class Store < ActiveRecord::Base
has_one :report, as: :reportable
# ...
end
But getting only:
> Store.take.build_report
Store Load (0.6ms) SELECT "stores".* FROM "stores" LIMIT 1
NoMethodError: undefined method `sanitize_limit' for #<Object:0x000001059b8ba0>
from /Users/jibiel/.rvm/gems/ruby-2.0.0-p451@smth/gems/activerecord-4.0.0/lib/active_record/relation/query_methods.rb:808:in `build_arel'
Is this currently supported? Could you please provide an example?
I suspect this is rather me not understanding things than lack of implementation.
Anyways, it'll be great to see such example in the README.md.
Thanks.