public
Created

Refactored Post

  • Download Gist
refactored_post.rb
Ruby
1 2 3 4 5 6 7 8
class Post < ActiveRecord::Base
composed_of :location, mapping: [%w(location_country country),
%w(location_city city)]
 
def self.all_posts_from location
Post.where location: location
end
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.