Class: ActiveRecord::Base
Class Method Summary collapse
- .attribute_names ⇒ Object
-
.has_attribute?(attribute_sym) ⇒ Boolean
checks to see if attribute_sym is either in the column name list, or in the set of reflections.
Instance Method Summary collapse
Class Method Details
.attribute_names ⇒ Object
112 113 114 |
# File 'lib/clevic/sequel_ar_adapter.rb', line 112 def self.attribute_names ( column_names + reflections.keys.map {|sym| sym.to_s} ).sort end |
.has_attribute?(attribute_sym) ⇒ Boolean
checks to see if attribute_sym is either in the column name list, or in the set of reflections.
102 103 104 105 106 107 108 109 110 |
# File 'lib/clevic/sequel_ar_adapter.rb', line 102 def self.has_attribute?( attribute_sym ) if column_names.include?( attribute_sym.to_s ) true elsif reflections.has_key?( attribute_sym ) true else false end end |
Instance Method Details
#adaptor ⇒ Object
116 117 118 |
# File 'lib/clevic/sequel_ar_adapter.rb', line 116 def adaptor @adaptor ||= Clevic::ActiveRecordAdaptor.new( self ) end |