Guest User

Untitled

a guest
May 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. # put this in app/models/search.rb
  2. class Search
  3. attr_accessor :attributes
  4.  
  5. def initialize(attributes = {})
  6. @attributes = attributes
  7. @attributes.each do |k,v|
  8. self.class.send(:define_method,k) { v }
  9. end
  10. end
  11. end
Add Comment
Please, Sign In to add comment