Class: TinyCore::TablelessModel
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- TinyCore::TablelessModel
- Defined in:
- lib/tiny_core/tableless_model.rb
Class Method Summary collapse
-
.column(name, sql_type = nil, default = nil, null = true) ⇒ Object
:nodoc:.
-
.reset_column_information ⇒ Object
Do not reset @columns.
Instance Method Summary collapse
-
#create_or_update ⇒ Object
:nodoc:.
Class Method Details
.column(name, sql_type = nil, default = nil, null = true) ⇒ Object
:nodoc:
17 18 19 20 |
# File 'lib/tiny_core/tableless_model.rb', line 17 def column(name, sql_type = nil, default = nil, null = true) # :nodoc: columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null) reset_column_information end |
.reset_column_information ⇒ Object
Do not reset @columns
23 24 25 26 |
# File 'lib/tiny_core/tableless_model.rb', line 23 def reset_column_information # :nodoc: generated_methods.each { |name| undef_method(name) } @column_names = @columns_hash = @content_columns = @dynamic_methods_hash = @generated_methods = nil end |
Instance Method Details
#create_or_update ⇒ Object
:nodoc:
9 10 11 |
# File 'lib/tiny_core/tableless_model.rb', line 9 def create_or_update # :nodoc: errors.empty? end |