lib/moribus/alias_association.rb
# Aliases association methods for a given association reflections: creates
# association accessors aliases (such as <tt>other</tt> and <tt>other=</tt>),
# also aliases association-specific methods(such as <tt>build_other</tt> and
# <tt>create_other</tt> for singular association, and <tt>other_ids</tt> and
# <tt>other_ids=</tt> for collection association)
Aliases association methods for a given association reflections: creates
association accessors aliases (such as other and other=),
also aliases association-specific methods(such as build_other and
create_other for singular association, and other_ids and
other_ids= for collection association)
Aliases association methods for a given association reflections : creates association accessors aliases ( such as other and other = ) also aliases association - specific methods ( such as build_other and create_other for singular association and other_ids and other_ids = for collection association )
def alias_association_methods(alias_name, reflection)
        association_name = reflection.name
        alias_association_accessor_methods(alias_name, association_name)
        case reflection.macro
          when :has_one, :belongs_to
            alias_singular_association_methods(alias_name, association_name)
          when :has_many, :has_and_belongs_to_many
            alias_collection_association_methods(alias_name, association_name)
        end
      end
def alias_association_methods ( alias_name , reflection ) association_name = reflection . name alias_association_accessor_methods ( alias_name , association_name ) case reflection . macro when :has_one , :belongs_to alias_singular_association_methods ( alias_name , association_name ) when :has_many , :has_and_belongs_to_many alias_collection_association_methods ( alias_name , association_name ) end end
Aliases association methods for a given association reflections: creates
association accessors aliases (such as <tt>other</tt> and <tt>other=</tt>),
also aliases association-specific methods(such as <tt>build_other</tt> and
<tt>create_other</tt> for singular association, and <tt>other_ids</tt> and
<tt>other_ids=</tt> for collection association)
Aliases association methods for a given association reflections : creates association accessors aliases ( such as <tt > other< / tt > and <tt > other = < / tt > ) also aliases association - specific methods ( such as <tt > build_other< / tt > and <tt > create_other< / tt > for singular association and <tt > other_ids< / tt > and <tt > other_ids = < / tt > for collection association )
alias_name
reflection