Skip to content

Instantly share code, notes, and snippets.

View lorenzoplanas's full-sized avatar
💭
🏖️

Lorenzo Planas lorenzoplanas

💭
🏖️
  • Spain
View GitHub Profile
class Post
include Mongoid::Document
field :title, :type => String
has_many :comments do
def update(selector, params)
@target.each { |t| t.update_attributes(params) if t.matches?(selector) }
end
end
end