Invalid mix of scope block and deprecated finder options on ActiveRecord association

While upgrading from rails to rails 4.2.6

has_many :subitems, through: :child_associations, source: :child, source_type: 'ContentItem', conditions: 'content_items.deleted  1', order: 'content_associations.position ASC'
  1. Replaced conditions with proc
has_many :subitems, ->{where('content_items.deleted  1')}, through: :child_associations, source: :child, source_type: 'ContentItem',  order: 'content_associations.position ASC'

2. Place order in proc

has_many :subitems, ->{where('content_items.deleted  1').order('content_associations.position ASC') }, through: :child_associations, source: :child, source_type: 'ContentItem'

I am Senior Software Engineer. I love reading, writing, sharing,developing, hiking, movies, trips, mountains, brooks, hills etc.

Posted in Uncategorized, upgrade from rails 3 to 4

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: