Class: DbDumper::QueryBuilder::Table
- Inherits:
-
Object
- Object
- DbDumper::QueryBuilder::Table
- Defined in:
- lib/db_dumper/query_builder/table.rb
Overview
Storage for generated classes inherited from ActiveRecord::Base
Instance Attribute Summary collapse
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
9 10 11 |
# File 'lib/db_dumper/query_builder/table.rb', line 9 def table_name @table_name end |
Class Method Details
.from(raw_table) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/db_dumper/query_builder/table.rb', line 13 def self.from(raw_table) return raw_table if raw_table.is_a?(Table) table_name_str = raw_table.to_s @tables[table_name_str] ||= new(table_name_str) end |
Instance Method Details
#ar ⇒ Object
20 21 22 23 24 |
# File 'lib/db_dumper/query_builder/table.rb', line 20 def ar @ar ||= Class.new(ActiveRecord::Base).tap do |klass| klass.table_name = table_name end end |