Sha256: 2cd89b63cc443316e2e77d9a09b4e515517352d3fb450b4a3a9001cec717fa20

Contents?: true

Size: 318 Bytes

Versions: 10

Compression:

Stored size: 318 Bytes

Contents

module MongoModel
  module ActiveModelCompatibility
    extend ActiveSupport::Concern
    
    include ActiveModel::Conversion
    
    def persisted?
      !new_record?
    end
    
    def to_key
      persisted? ? super : nil
    end
    
    module ClassMethods
      include ActiveModel::Naming
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
mongomodel-0.5.5 lib/mongomodel/concerns/activemodel.rb
mongomodel-0.5.4 lib/mongomodel/concerns/activemodel.rb
mongomodel-0.5.3 lib/mongomodel/concerns/activemodel.rb
mongomodel-0.5.2 lib/mongomodel/concerns/activemodel.rb
mongomodel-0.5.1 lib/mongomodel/concerns/activemodel.rb
mongomodel-0.5.0 lib/mongomodel/concerns/activemodel.rb
mongomodel-0.4.9 lib/mongomodel/concerns/activemodel.rb
mongomodel-0.4.8 lib/mongomodel/concerns/activemodel.rb
mongomodel-0.4.7 lib/mongomodel/concerns/activemodel.rb
mongomodel-0.4.6 lib/mongomodel/concerns/activemodel.rb