Sha256: d025af20e86f9d798d7ca85406e3950909da41decc5634c6ffede234d9db0ac6
Contents?: true
Size: 533 Bytes
Versions: 2
Compression:
Stored size: 533 Bytes
Contents
module Blogs class Comment include Mongoid::Document field :content field :locale index :locale before_validation :assign_current_locale validates :content, :presence => true validates :locale, :presence => true embedded_in :blog_post, :inverse_of => :comments scope :ordered, asc(:_id) scope :in_current_locale, lambda { where(:locale => I18n.locale.to_s) } private def assign_current_locale self.locale ||= I18n.locale.to_s end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rspec_extensions_collection-0.0.4 | spec/models/blogs/comment.rb |
rspec_extensions_collection-0.0.3 | spec/models/blogs/comment.rb |