Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Jul 27, 2012
  1. Jon Leighton

    ActiveRecord::Base.all returns a Relation.

    jonleighton authored
    Previously it returned an Array.
    If you want an array, call e.g. `Post.to_a` rather than `Post.all`. This
    is more explicit.
    In most cases this should not break existing code, since
    Relations use method_missing to delegate unknown methods to #to_a
Commits on Jul 20, 2012
  1. Rafael Mendonça França
  2. Rafael Mendonça França
  3. Rafael Mendonça França

    `validates_inclusion_of` and `validates_exclusion_of` now accept

    rafaelfranca authored
    `:within` option as alias of `:in` as documented.
    Fix #7118
Commits on Jul 10, 2012
  1. Bogdan Gusiev
Commits on Jul 7, 2012
  1. Vijay Dev
  2. Carlos Antonio da Silva

    Merge pull request #6938 from acapilleri/as_json_refactoring

    carlosantoniodasilva authored
    Small refactoring of as_json method
Commits on Jul 6, 2012
  1. Francesco Rodríguez
  2. Francesco Rodríguez
Commits on Jul 5, 2012
  1. Francesco Rodríguez
  2. Francesco Rodríguez
  3. Francesco Rodríguez
Commits on Jul 3, 2012
  1. Angelo Capilleri

    small refactoring of as_json method

    acapilleri authored
    with this change root has always one assignment
  2. Angelo Capilleri
Commits on Jul 1, 2012
  1. Buddhika Laknath

    Changed attr_accessible example to reflect grouped roles

    laknath authored
    Related to the request #5699 - #5699 and
    not documented.
Commits on Jun 30, 2012
  1. Vijay Dev

    Merge branch 'master' of

    vijaydev authored
Commits on Jun 27, 2012
  1. Carlos Antonio da Silva
  2. Carlos Antonio da Silva

    Cleanup attribute methods a bit, use map! when accepting *args

    carlosantoniodasilva authored
    Since we're dealing with a new array instance, it's safe to use map! and
    we avoid an extra array object.
    Also remove the symbolize_keys! from AttributeMethodMatcher, since it's
    an internal class that always receives symbol keys from the prefix/suffix
    methods implementations.
  3. Carlos Antonio da Silva

    Use default + merge! instead of reverse_merge

    carlosantoniodasilva authored
    Since we're not directly requiring the reverse_merge extension, we can
    avoid another hash creation by using default_hash.merge! instead.
  4. Carlos Antonio da Silva

    Set hash value instead of merge a single key, and use flatten! if pos…

    carlosantoniodasilva authored
    There's no need to create two extra hashes with options.merge(another_hash),
    with the goal of setting only one value, so lets just set it.
    Also refactor validates_each to use _merge_attributes, like other
    validates_* helpers do.
Commits on Jun 25, 2012
  1. Francesco Rodríguez
  2. Carlos Antonio da Silva

    Make internal callback model definitions private in AMo

    carlosantoniodasilva authored
    These _define class methods don't need to be exposed to objects that
    extend ActiveModel::Callbacks.
    Also use merge! options to avoid the creation of an extra hash.
  3. Francesco Rodríguez
  4. Francesco Rodríguez
Commits on Jun 23, 2012
  1. Francesco Rodríguez
  2. Francesco Rodríguez
  3. Francesco Rodríguez
Commits on Jun 22, 2012
  1. Francesco Rodríguez
  2. Francesco Rodríguez
  3. Francesco Rodríguez
  4. Francesco Rodríguez
  5. Francesco Rodríguez

    change param name to improve documentation

    frodsan authored
    The keys of the error messages are actually attribute names. It makes
    the documentation easier to understand:
        # Returns +true+ if the error messages include an error for the given
        # +attribute+, +false+ otherwise.
        #   person.errors.messages # => { :name => ["can not be nil"] }
        #   person.errors.include?(:name) # => true
        #   person.errors.include?(:age)  # => false
        def include?(attribute)
          (v = messages[attribute]) && v.any?
  6. Francesco Rodríguez
  7. Francesco Rodríguez
  8. Vijay Dev
Something went wrong with that request. Please try again.