Sha256: 403ebfda78067bf6887db40ae729fbfa7260b34b166665c300350b71c8276e93

Contents?: true

Size: 760 Bytes

Versions: 3

Compression:

Stored size: 760 Bytes

Contents

module Arel
  module Attributes
    class Relation < Attribute
      
      attr_accessor :collection, :for_write
      
      def initialize(relation, name, collection = false, for_write=false)
        self[:relation] = relation
        self[:name] = name
        @collection = collection
        @for_write = for_write
      end
      
      def able_to_type_cast?
        false
      end
      
      def table_name
        nil
      end
      
      def eql? other
        self.class == other.class &&
          self.relation == other.relation &&
          self.name == other.name &&
          self.collection == other.collection
      end

      def type_cast_for_database(value)
        relation.type_cast_for_database(value)
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
arel-extensions-6.1.0.rc1 lib/arel/nodes/relation.rb
arel-extensions-6.0.0.9 lib/arel/nodes/relation.rb
arel-extensions-6.0.0.8 lib/arel/nodes/relation.rb