Sha256: 57ce4792b6d852a189379f331f147a98121280b3fa6c875cae66efa66cca968a
Contents?: true
Size: 666 Bytes
Versions: 13
Compression:
Stored size: 666 Bytes
Contents
case Merit.orm when :active_record class Comment < ActiveRecord::Base def friend User.find_by_name('friend') end end when :mongoid class Comment include Mongoid::Document include Mongoid::Timestamps field :name, :type => String field :comment, :type => String field :votes, :type => Integer, :default => 0 def friend User.find_by(name: 'friend') end end end class Comment has_merit belongs_to :user if show_attr_accessible? attr_accessible :name, :comment, :user_id, :votes end validates :name, :comment, :user_id, :presence => true delegate :comments, :to => :user, :prefix => true end
Version data entries
13 entries across 13 versions & 1 rubygems