Module: Randumb::ActiveRecord::MethodMissingMagicks
- Included in:
- ActiveRecord::Base, ActiveRecord::Relation
- Defined in:
- lib/randumb/relation.rb
Overview
These get registered as class and instance methods
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(symbol, *args) ⇒ Object
187 188 189 190 191 192 193 194 |
# File 'lib/randumb/relation.rb', line 187 def method_missing(symbol, *args) if symbol.to_s =~ /^random_weighted_by_(\w+)$/ ActiveSupport::Deprecation.warn "Dynamic finders will be removed in randumb 1.0 http://guides.rubyonrails.org/active_record_querying.html#dynamic-finders" random_weighted($1, *args) else super end end |
Instance Method Details
#respond_to?(symbol, include_private = false) ⇒ Boolean
196 197 198 199 200 201 202 203 |
# File 'lib/randumb/relation.rb', line 196 def respond_to?(symbol, include_private=false) if symbol.to_s =~ /^random_weighted_by_(\w+)$/ ActiveSupport::Deprecation.warn "Dynamic finders will be removed in randumb 1.0 http://guides.rubyonrails.org/active_record_querying.html#dynamic-finders" true else super end end |