diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-03-10 23:32:05 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-03-10 23:32:05 +0900 |
commit | 4368dba5eea2fe5e06dabf26b62e20ccee274644 (patch) | |
tree | 90490e9e43c757e4cff16b821bf9cfe7c87408fc /activerecord/lib/active_record | |
parent | c8c1460f7a97c15dff641a30e63914991d407595 (diff) | |
download | rails-4368dba5eea2fe5e06dabf26b62e20ccee274644.tar.gz rails-4368dba5eea2fe5e06dabf26b62e20ccee274644.tar.bz2 rails-4368dba5eea2fe5e06dabf26b62e20ccee274644.zip |
Simply delegate `as_json` to `records`
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/relation.rb | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/relation/delegation.rb | 2 |
2 files changed, 1 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index 61ee09bcc8..2d6b21bec5 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -261,10 +261,6 @@ module ActiveRecord coder.represent_seq(nil, records) end - def as_json(options = nil) #:nodoc: - records.as_json(options) - end - # Returns size of the records. def size loaded? ? @records.length : count(:all) diff --git a/activerecord/lib/active_record/relation/delegation.rb b/activerecord/lib/active_record/relation/delegation.rb index d3ba724507..0612151584 100644 --- a/activerecord/lib/active_record/relation/delegation.rb +++ b/activerecord/lib/active_record/relation/delegation.rb @@ -38,7 +38,7 @@ module ActiveRecord delegate :to_xml, :encode_with, :length, :collect, :map, :each, :all?, :include?, :to_ary, :join, :[], :&, :|, :+, :-, :sample, :reverse, :compact, :in_groups, :in_groups_of, - :to_sentence, :to_formatted_s, + :to_sentence, :to_formatted_s, :as_json, :shuffle, :split, :index, to: :records delegate :table_name, :quoted_table_name, :primary_key, :quoted_primary_key, |