Class: ActiveRecordPgStuff::Relation::TemporaryTable::Decorator
- Inherits:
-
Object
- Object
- ActiveRecordPgStuff::Relation::TemporaryTable::Decorator
- Defined in:
- lib/activerecord_pg_stuff/relation/temporary_table.rb
Instance Attribute Summary collapse
-
#arel_table ⇒ Object
readonly
Returns the value of attribute arel_table.
-
#predicate_builder ⇒ Object
readonly
Returns the value of attribute predicate_builder.
-
#quoted_table_name ⇒ Object
readonly
Returns the value of attribute quoted_table_name.
-
#table_metadata ⇒ Object
readonly
Returns the value of attribute table_metadata.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Instance Method Summary collapse
-
#initialize(object, table_name) ⇒ Decorator
constructor
A new instance of Decorator.
- #method_missing(name, *args, &block) ⇒ Object
- #respond_to?(name, *args) ⇒ Boolean
Constructor Details
#initialize(object, table_name) ⇒ Decorator
Returns a new instance of Decorator.
9 10 11 12 13 14 15 16 |
# File 'lib/activerecord_pg_stuff/relation/temporary_table.rb', line 9 def initialize(object, table_name) @table_name = table_name @object = object @arel_table = Arel::Table.new(table_name) @quoted_table_name = @object.connection.quote_table_name(table_name) @table_metadata = ActiveRecord::TableMetadata.new(self, @arel_table) @predicate_builder = ActiveRecord::PredicateBuilder.new(@table_metadata) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
18 19 20 |
# File 'lib/activerecord_pg_stuff/relation/temporary_table.rb', line 18 def method_missing(name, *args, &block) @object.send(name, *args, &block) end |
Instance Attribute Details
#arel_table ⇒ Object (readonly)
Returns the value of attribute arel_table.
7 8 9 |
# File 'lib/activerecord_pg_stuff/relation/temporary_table.rb', line 7 def arel_table @arel_table end |
#predicate_builder ⇒ Object (readonly)
Returns the value of attribute predicate_builder.
7 8 9 |
# File 'lib/activerecord_pg_stuff/relation/temporary_table.rb', line 7 def predicate_builder @predicate_builder end |
#quoted_table_name ⇒ Object (readonly)
Returns the value of attribute quoted_table_name.
7 8 9 |
# File 'lib/activerecord_pg_stuff/relation/temporary_table.rb', line 7 def quoted_table_name @quoted_table_name end |
#table_metadata ⇒ Object (readonly)
Returns the value of attribute table_metadata.
7 8 9 |
# File 'lib/activerecord_pg_stuff/relation/temporary_table.rb', line 7 def @table_metadata end |
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
7 8 9 |
# File 'lib/activerecord_pg_stuff/relation/temporary_table.rb', line 7 def table_name @table_name end |
Instance Method Details
#respond_to?(name, *args) ⇒ Boolean
22 23 24 |
# File 'lib/activerecord_pg_stuff/relation/temporary_table.rb', line 22 def respond_to?(name, *args) @object.respond_to?(name, *args) end |