Disable ActiveRecord::Dirty when ActiveRecord with readonly purpose

43 views
Skip to first unread message

rask kumar

unread,
Jun 7, 2015, 2:17:21 PM6/7/15
to rubyonra...@googlegroups.com
Consider I am having the table called 'Order' with 50 columns.

In the Restful behavior like OrdersController#New, #Update, # Create, #Delete in this ActiveRecord::Dirty methods are necessary.

In the OrdersController#Index, ActiveRecord defines Dirty methods unnecessarily.

In my case for loading single ActiveRecord object for order will define 50(Columns)*4(DIRTY_SUFFIXES)= 200 methods.

If any option to disable the Dirty methods, that will be awesome!

mateo

unread,
Jun 8, 2015, 4:24:50 PM6/8/15
to rubyonra...@googlegroups.com
The methods are defined via method_missing, so they are only created if they are actually used
Reply all
Reply to author
Forward
0 new messages