Module: Sequel::Plugins::Clevic::ClassMethods
- Defined in:
- lib/clevic/sequel_clevic.rb
Instance Method Summary collapse
- #attribute_names ⇒ Object
-
#column_names ⇒ Object
Hmm, maybe these need to go in a different plugin.
- #has_attribute?(attribute) ⇒ Boolean
-
#inherited(subclass) ⇒ Object
Copy the necessary class instance variables to the subclass.
-
#reflections ⇒ Object
Getting heavy enough, yet?.
-
#table_exists? ⇒ Boolean
This doesn’t really belong here, but I don’t want to make a whole new plugin.
Instance Method Details
#attribute_names ⇒ Object
37 38 39 |
# File 'lib/clevic/sequel_clevic.rb', line 37 def attribute_names columns + reflections.keys end |
#column_names ⇒ Object
Hmm, maybe these need to go in a different plugin
28 29 30 |
# File 'lib/clevic/sequel_clevic.rb', line 28 def column_names columns end |
#has_attribute?(attribute) ⇒ Boolean
41 42 43 |
# File 'lib/clevic/sequel_clevic.rb', line 41 def has_attribute?( attribute ) attribute_names.include?( attribute ) end |
#inherited(subclass) ⇒ Object
Copy the necessary class instance variables to the subclass.
17 18 19 |
# File 'lib/clevic/sequel_clevic.rb', line 17 def inherited(subclass) super end |
#reflections ⇒ Object
Getting heavy enough, yet?
33 34 35 |
# File 'lib/clevic/sequel_clevic.rb', line 33 def reflections association_reflections end |
#table_exists? ⇒ Boolean
This doesn’t really belong here, but I don’t want to make a whole new plugin.
23 24 25 |
# File 'lib/clevic/sequel_clevic.rb', line 23 def table_exists? db.table_exists?( implicit_table_name ) end |