Exception: Authz::Scopables::Base::AmbiguousAssociationName
- Inherits:
-
StandardError
- Object
- StandardError
- Authz::Scopables::Base::AmbiguousAssociationName
- Defined in:
- lib/authz/scopables/base.rb
Overview
Error that will be raised if the model being scoped has ambiguous association names for the included scopable (e.g. has both :city and :cities associations and ScopableByCity is Being included)
Instance Attribute Summary collapse
- #association_names ⇒ Object readonly
- #scopable ⇒ Object readonly
- #scoped_class ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ AmbiguousAssociationName
constructor
A new instance of AmbiguousAssociationName.
Constructor Details
#initialize(options = {}) ⇒ AmbiguousAssociationName
Returns a new instance of AmbiguousAssociationName.
76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/authz/scopables/base.rb', line 76 def initialize( = {}) @scoped_class = .fetch(:scoped_class) @scopable = .fetch :scopable @association_names = .fetch :association_names = "#{scoped_class} has ambiguous association names " \ "#{association_names} for #{scopable}. " \ 'Use the ' \ "set_scopable_by_#{scopable.scoping_class_name.underscore}_association_name " \ 'method to define it manually.' super() end |
Instance Attribute Details
#association_names ⇒ Object (readonly)
74 75 76 |
# File 'lib/authz/scopables/base.rb', line 74 def association_names @association_names end |
#scopable ⇒ Object (readonly)
74 75 76 |
# File 'lib/authz/scopables/base.rb', line 74 def scopable @scopable end |
#scoped_class ⇒ Object (readonly)
74 75 76 |
# File 'lib/authz/scopables/base.rb', line 74 def scoped_class @scoped_class end |