Module: CouchbaseOrm::ActiveRecordCompat::ClassMethods

Defined in:
lib/couchbase-orm/base.rb

Instance Method Summary collapse

Instance Method Details

#_reflect_on_association(_attribute) ⇒ Object



67
68
69
# File 'lib/couchbase-orm/base.rb', line 67

def _reflect_on_association(_attribute)
  false
end

#abstract_class?Boolean

Returns:



55
56
57
# File 'lib/couchbase-orm/base.rb', line 55

def abstract_class?
  false
end

#attribute_namesObject



84
85
86
# File 'lib/couchbase-orm/base.rb', line 84

def attribute_names
  attribute_types.keys
end

#attributes_builderObject

:nodoc:



75
76
77
78
79
80
81
# File 'lib/couchbase-orm/base.rb', line 75

def attributes_builder # :nodoc:
  unless defined?(@attributes_builder) && @attributes_builder
    defaults = _default_attributes
    @attributes_builder = ActiveModel::AttributeSet::Builder.new(attribute_types, defaults)
  end
  @attributes_builder
end

#base_class?Boolean

Returns:



46
47
48
# File 'lib/couchbase-orm/base.rb', line 46

def base_class?
  true
end

#column_namesObject

can't be an alias for now



51
52
53
# File 'lib/couchbase-orm/base.rb', line 51

def column_names
  attribute_names
end

#connected?Boolean

Returns:



59
60
61
# File 'lib/couchbase-orm/base.rb', line 59

def connected?
  true
end

#primary_keyObject



42
43
44
# File 'lib/couchbase-orm/base.rb', line 42

def primary_key
  'id'
end

#table_exists?Boolean

Returns:



63
64
65
# File 'lib/couchbase-orm/base.rb', line 63

def table_exists?
  true
end

#type_for_attribute(attribute) ⇒ Object



71
72
73
# File 'lib/couchbase-orm/base.rb', line 71

def type_for_attribute(attribute)
  attribute_types[attribute]
end