Module: Ixtlan::ModifiedBy::ClassMethods
- Defined in:
- lib/ixtlan/modified_by.rb
Instance Method Summary collapse
Instance Method Details
#modified_by(type, names = nil, options = {}) ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/ixtlan/modified_by.rb', line 59 def modified_by(type, names = nil, = {}) if(names.nil?) modified_by(type, [:created_by, :updated_by], ) else names = [names] unless names.is_a?(Enumerable) names.each do |name| case name when *MODIFIED_BY_PROPERTIES.keys belongs_to name, .merge!({:model => type.to_s}) else raise ::DataMapper::InvalidModifiedByName, "Invalid 'modified by' name '#{name}'" end end end end |