Flowdock
method

only

Importance_0
v3.0.5 - Show latest stable - 0 notes - Class: ActiveRecord::SpawnMethods
only(*onlies) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/relation/spawn_methods.rb, line 89
    def only(*onlies)
      result = self.class.new(@klass, table)

      ((Relation::ASSOCIATION_METHODS + Relation::MULTI_VALUE_METHODS) & onlies).each do |method|
        result.send("#{method}_values=""#{method}_values=", send("#{method}_values""#{method}_values"))
      end

      (Relation::SINGLE_VALUE_METHODS & onlies).each do |method|
        result.send("#{method}_value=""#{method}_value=", send("#{method}_value""#{method}_value"))
      end

      result
    end
Register or log in to add new notes.