Created
January 29, 2016 12:20
-
-
Save lappi-lynx/a415cf3fbac941e3e1f0 to your computer and use it in GitHub Desktop.
Rails: Convert array into ActiveRecord Relation object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scope :with_scope, -> { where(id: ARRAY_COLLECTION.map(&:id)) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this gives
(byebug) Offer.where(id: offers.map(&:id)) *** NameError Exception: uninitialized constant ActionView::CompiledTemplates::Offer