Sha256: 8e7826f282d813ebd4efd719a3622dd0e775802fa671fda2f2ed269f25131494

Contents?: true

Size: 907 Bytes

Versions: 5

Compression:

Stored size: 907 Bytes

Contents

require "couchbase-orm/types/date"
require "couchbase-orm/types/date_time"
require "couchbase-orm/types/timestamp"
require "couchbase-orm/types/array"
require "couchbase-orm/types/nested"
require "couchbase-orm/types/encrypted"

if ActiveModel::VERSION::MAJOR < 6
  # In Rails 5, the type system cannot allow overriding the default types
  ActiveModel::Type.registry.instance_variable_get(:@registrations).delete_if do |k|
    k.matches?(:date) || k.matches?(:datetime) || k.matches?(:timestamp)
  end
end

ActiveModel::Type.register(:date, CouchbaseOrm::Types::Date)
ActiveModel::Type.register(:datetime, CouchbaseOrm::Types::DateTime)
ActiveModel::Type.register(:timestamp, CouchbaseOrm::Types::Timestamp)
ActiveModel::Type.register(:array, CouchbaseOrm::Types::Array)
ActiveModel::Type.register(:nested, CouchbaseOrm::Types::Nested)
ActiveModel::Type.register(:encrypted, CouchbaseOrm::Types::Encrypted)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
couchbase-orm-2.0.4 lib/couchbase-orm/types.rb
couchbase-orm-2.0.3 lib/couchbase-orm/types.rb
couchbase-orm-2.0.2 lib/couchbase-orm/types.rb
couchbase-orm-2.0.1 lib/couchbase-orm/types.rb
couchbase-orm-2.0.0 lib/couchbase-orm/types.rb