Class: Ansr::DummyAssociations::DummyReflection

Inherits:
ActiveRecord::Reflection::AggregateReflection
  • Object
show all
Defined in:
lib/ansr/dummy_associations.rb

Instance Method Summary collapse

Constructor Details

#initialize(macro, name, scope, options, active_record) ⇒ DummyReflection

Returns a new instance of DummyReflection.



63
64
65
66
# File 'lib/ansr/dummy_associations.rb', line 63

def initialize(macro, name, scope, options, active_record)
  super(macro, name, scope, options, active_record)
  @symbol = name
end

Instance Method Details

#association_classObject



81
82
83
# File 'lib/ansr/dummy_associations.rb', line 81

def association_class
  DummyAssociation
end

#check_validity!Object



85
86
87
# File 'lib/ansr/dummy_associations.rb', line 85

def check_validity!
  true
end

#collection?Boolean

Returns:

  • (Boolean)


75
76
77
# File 'lib/ansr/dummy_associations.rb', line 75

def collection?
  [:has_one, :has_many, :has_and_belongs_to_many].include? macro
end

#foreign_keyObject



72
73
74
# File 'lib/ansr/dummy_associations.rb', line 72

def foreign_key
  @symbol # ??
end

#polymorphic?Boolean

Returns:

  • (Boolean)


68
69
70
# File 'lib/ansr/dummy_associations.rb', line 68

def polymorphic?
  false
end

#validate?Boolean

Returns:

  • (Boolean)


78
79
80
# File 'lib/ansr/dummy_associations.rb', line 78

def validate?
  false
end