Module: Sequel::Plugins::Clevic::ClassMethods

Defined in:
lib/clevic/sequel_clevic.rb

Instance Method Summary collapse

Instance Method Details

#attribute_namesObject



37
38
39
# File 'lib/clevic/sequel_clevic.rb', line 37

def attribute_names
  columns + reflections.keys
end

#column_namesObject

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

Returns:

  • (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

#reflectionsObject

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.

Returns:

  • (Boolean)


23
24
25
# File 'lib/clevic/sequel_clevic.rb', line 23

def table_exists?
  db.table_exists?( implicit_table_name )
end