Notes posted by diabolist
RSS feed
diabolist -
February 4, 2013
0 thanks
Your scope cannot be called 'locked'
-
see: http://github.com/rails/rails/pull/6985
class Article < ActiveRecord::Base scope :locked, where(... end
will cause intermittent problems of the type
undefined method 'locked' for #<Class:0x007fdab3025298>
Use something like ‘access_locked’ instead
diabolist -
June 30, 2009
3 thanks
Be careful with name of attribute writer
If restricting access to attributes you normally get code like
attr_accessible :foo,
When using these nested attributes you end up with code like
attr_accessible :foo, :bar_attributes
Its very easy to leave of the _attributes suffix e.g
attr_accessible :foo, :bar
which will cause you all sorts of problems