Skip to content

Instantly share code, notes, and snippets.

View bricesanchez's full-sized avatar
🎯
Focusing

Brice Sanchez bricesanchez

🎯
Focusing
View GitHub Profile
@bricesanchez
bricesanchez / Spree: Filter by brand.md
Last active August 29, 2015 14:27 — forked from maxivak/Spree: Filter by brand.md
Spree: Filter Products by properties

Fix 'scoped' error for Rails 4

error: undefined method 'scoped' solution:

# config/initializers/scoped.rb
class ActiveRecord::Base
  # do things the modern way and silence Rails 4 deprecation warnings
 def self.scoped(options=nil)

options ? where(nil).apply_finder_options(options, true) : where(nil)