Class: Arel::Lock
- Defined in:
- lib/arel/algebra/relations/operations/lock.rb
Instance Attribute Summary collapse
-
#locked ⇒ Object
readonly
Returns the value of attribute locked.
Attributes inherited from Compound
Attributes included from Relation
Instance Method Summary collapse
-
#initialize(relation, locked) ⇒ Lock
constructor
A new instance of Lock.
Methods inherited from Compound
#attributes, #column_for, #externalizable?, #join?, #joins, #name, #skipped, #sources, #table, #table_alias, #table_sql, #taken, #unoperated_rows
Methods included from Relation
#[], #alias, #attributes, #bind, #call, #christener, #compiler, #delete, #each, #exclusion_predicate_sql, #externalizable?, #externalize, #find_attribute_matching_name, #from, #from_clauses, #group_clauses, #groupings, #having_clauses, #havings, #inclusion_predicate_sql, #insert, #inserts, #join, #join?, #joins, #lock, #order_clauses, #orders, #outer_join, #position_of, #primary_key, #project, #projections, #select_clauses, #session, #skip, #skipped, #sources, #take, #taken, #to_sql, #update, #where, #where_clauses, #wheres
Constructor Details
#initialize(relation, locked) ⇒ Lock
5 6 7 8 |
# File 'lib/arel/algebra/relations/operations/lock.rb', line 5 def initialize(relation, locked) super(relation) @locked = true == locked ? " FOR UPDATE" : locked end |
Instance Attribute Details
#locked ⇒ Object (readonly)
Returns the value of attribute locked.
3 4 5 |
# File 'lib/arel/algebra/relations/operations/lock.rb', line 3 def locked @locked end |