lib/moribus/extensions.rb
# Overrides Rails' default #association method to extend resulting
# +association+ objects by custom behaviors.
Overrides Rails' default #association method to extend resulting
+association+ objects by custom behaviors.
Overrides Rails ' default #association method to extend resulting + association + objects by custom behaviors .
def association(name)
      association = super
      reflection = self.class.reflect_on_association(name)
      case reflection.try(:macro)
        when :belongs_to
          association.extend(HasAggregatedExtension) if reflection.options[:aggregated]
        when :has_one
          association.extend(HasCurrentExtension) if reflection.options[:is_current]
        else 
      end
      association
    end
def association ( name ) association = super reflection = self . class . reflect_on_association ( name ) case reflection . try ( :macro ) when :belongs_to association . extend ( HasAggregatedExtension ) if reflection . options [ :aggregated ] when :has_one association . extend ( HasCurrentExtension ) if reflection . options [ :is_current ] else end association end
Overrides Rails' default #association method to extend resulting
+association+ objects by custom behaviors.
Overrides Rails ' default #association method to extend resulting + association + objects by custom behaviors .
# do nothing
name