lib/moribus/extensions/has_aggregated_extension.rb
def methods_to_delegate_to(reflection)
          klass = reflection.klass
          enum_methods = klass.reflect_on_all_enumerated.map do |reflection|
            name = reflection.name
            [name, "#{name}="]
          end
          klass.define_attribute_methods
          attribute_methods = klass.__send__(:generated_attribute_methods).instance_methods.select{ |m| m !~ EXCLUDE_METHODS_REGEXP }
          custom_writers = klass.instance_methods(false).map(&:to_s) & klass.column_names.map{ |name| "#{name}=" }
          (attribute_methods + enum_methods.flatten + custom_writers).map(&:to_sym)
        end
# Return a list of methods we want to delegate to the association:
# will generate attribute methods for a klass if they have not yet
# been generated by Rails, and will select reader and writer methods
# from the generated model. Also, adds enum readers and writers to
# a result. Also, it selects methods that can be treated as
# 'custom_writers' - they were declared within the class itself
# and have a names like '<column_name>='
Return a list of methods we want to delegate to the association:
will generate attribute methods for a klass if they have not yet
been generated by Rails, and will select reader and writer methods
from the generated model. Also, adds enum readers and writers to
a result. Also, it selects methods that can be treated as
'custom_writers' - they were declared within the class itself
and have a names like '='
Return a list of methods we want to delegate to the association : will generate attribute methods for a klass if they have not yet been generated by Rails and will select reader and writer methods from the generated model . Also adds enum readers and writers to a result . Also it selects methods that can be treated as ' custom_writers ' - they were declared within the class itself and have a names like ' = '
def methods_to_delegate_to(reflection)
          klass = reflection.klass
          enum_methods = klass.reflect_on_all_enumerated.map do |reflection|
            name = reflection.name
            [name, "#{name}="]
          end
          klass.define_attribute_methods
          attribute_methods = klass.__send__(:generated_attribute_methods).instance_methods.select{ |m| m !~ EXCLUDE_METHODS_REGEXP }
          custom_writers = klass.instance_methods(false).map(&:to_s) & klass.column_names.map{ |name| "#{name}=" }
          (attribute_methods + enum_methods.flatten + custom_writers).map(&:to_sym)
        end
def methods_to_delegate_to ( reflection ) klass = reflection . klass enum_methods = klass . reflect_on_all_enumerated . map do | reflection | name = reflection . name [ name , "#{name}=" ] end klass . define_attribute_methods attribute_methods = klass . __send__ ( :generated_attribute_methods ) . instance_methods . select { | m | m !~ EXCLUDE_METHODS_REGEXP } custom_writers = klass . instance_methods ( false ) . map ( & :to_s ) & klass . column_names . map { | name | "#{name}=" } ( attribute_methods + enum_methods . flatten + custom_writers ) . map ( & :to_sym ) end
Return a list of methods we want to delegate to the association:
will generate attribute methods for a klass if they have not yet
been generated by Rails, and will select reader and writer methods
from the generated model.
Return a list of methods we want to delegate to the association : will generate attribute methods for a klass if they have not yet been generated by Rails and will select reader and writer methods from the generated model .
reflection