lib/trust/controller/resource.rb
# Returns an accessor for association. Tries with full name association first, and if that does not match, tries the demodularized association.
#
# === Explanation
#
#   Assuming
#     resource is instance of Lottery::Package #1 (@lottery_package)
#     association is Lottery::Prizes
#     if association is named lottery_prizes, then that association is returned
#     if association is named prizes, then that association is returned
#
Returns an accessor for association. Tries with full name association first, and if that does not match, tries the demodularized association.
Explanation

Assuming
resource is instance of Lottery::Package #1 (@lottery_package)
association is Lottery::Prizes
if association is named lottery_prizes, then that association is returned
if association is named prizes, then that association is returned
Returns an accessor for association . Tries with full name association first and if that does not match tries the demodularized association . Explanation Assuming resource is instance of Lottery :: Package #1 ( @lottery_package ) association is Lottery :: Prizes if association is named lottery_prizes then that association is returned if association is named prizes then that association is returned
def relation(associated_resource)
        if associated_resource && associated_resource.object
          associated_resource.object.send(association_name(associated_resource))
        else
          klass
        end
      end
def relation ( associated_resource ) if associated_resource && associated_resource . object associated_resource . object . send ( association_name ( associated_resource ) ) else klass end end
Returns an accessor for association.
Returns an accessor for association .
associated_resource