Class: Arel::Attributes::Relation

Inherits:
Attribute
  • Object
show all
Defined in:
lib/motor/active_record_utils/active_record_filter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(relation, name, collection = false, for_write = false) ⇒ Relation

Returns a new instance of Relation.



13
14
15
16
17
18
# File 'lib/motor/active_record_utils/active_record_filter.rb', line 13

def initialize(relation, name, collection = false, for_write = false)
  self[:relation] = relation
  self[:name] = name
  @collection = collection
  @for_write = for_write
end

Instance Attribute Details

#collectionObject

Returns the value of attribute collection.



11
12
13
# File 'lib/motor/active_record_utils/active_record_filter.rb', line 11

def collection
  @collection
end

#for_writeObject

Returns the value of attribute for_write.



11
12
13
# File 'lib/motor/active_record_utils/active_record_filter.rb', line 11

def for_write
  @for_write
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
29
30
31
# File 'lib/motor/active_record_utils/active_record_filter.rb', line 26

def eql?(other)
  self.class == other.class &&
    relation == other.relation &&
    name == other.name &&
    collection == other.collection
end

#table_nameObject



22
23
24
# File 'lib/motor/active_record_utils/active_record_filter.rb', line 22

def table_name
  nil
end