aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * Capitalizing internet to Internet. [ci skip]Akshay Khole2013-05-032-2/+2
| |
| * added to rdoc for unscope that default_scope winsNeeraj Singh2013-05-031-0/+3
| |
| * Simple grammar updatesJonathan Roes2013-05-031-2/+2
| |
| * fix typoVipul A M2013-05-021-1/+1
| |
| * document String#to_time exceptionVipul A M2013-05-021-0/+1
| |
| * Clean up the wording in a few placesJonathan Roes2013-05-011-4/+4
| |
| * Add a few overview bullet pointsJonathan Roes2013-05-011-0/+4
| |
| * Fix typo "can exploited" with "can be exploited"Leo Gallucci2013-05-011-1/+1
| |
| * Rails 4 has deprecated :order in has_many to use a lambda instead, update ↵Nick Quaranto2013-05-011-1/+1
| | | | | | | | the guide accordingly
* | Merge pull request #10576 from sferik/remove_multi_json_dependencyYehuda Katz2013-05-114-46/+19
|\ \ | | | | | | Replace multi_json with json
| * | Replace multi_json with jsonErik Michaels-Ober2013-05-114-46/+19
|/ /
* | Merge pull request #10574 from wangjohn/automatic_inverse_of_documentationRafael Mendonça França2013-05-113-1/+33
|\ \ | | | | | | Adding documentation to the automatic inverse_of finder.
| * | Adding documentation to the automatic inverse_of finder.wangjohn2013-05-113-1/+33
|/ /
* | Improve CHANGELOG entry [ci kip]Rafael Mendonça França2013-05-111-6/+10
| |
* | Merge pull request #10503 from kstevens715/masterRafael Mendonça França2013-05-113-1/+32
|\ \ | | | | | | | | | Avoid method missing when calling assume_migrated_upto_version (master)
| * | Call assume_migrated_upto_version on connectionKyle Stevens2013-05-113-1/+32
|/ / | | | | | | | | | | | | | | | | | | | | Call assume_migrated_upto_version on connection to prevent it from first being picked up in method_missing. In the base class, Migration, method_missing expects the argument to be a table name, and calls proper_table_name on the arguments before sending to connection. If table_name_prefix or table_name_suffix is used, the schema version changes to prefix_version_suffix, breaking `rake test:prepare`. Fixes #10411.
* | Merge pull request #10567 from ↵Rafael Mendonça França2013-05-113-1/+7
|\ \ | | | | | | | | | | | | neerajdotname/read_attribute_before_type_cast_should_accept_symbol read_attribute_before_type_cast should accept symbol
| * | read_attribute_before_type_cast should accept symbolNeeraj Singh2013-05-113-1/+7
| | |
* | | Merge pull request #10572 from nertzy/dont-modify-options-hash-in-primary-keyRafael Mendonça França2013-05-111-2/+1
| | | | | | | | | | | | Don't modify args in TableDefinition#primary_key
* | | Merge pull request #10568 from siong1987/minor-refactoringXavier Noria2013-05-111-5/+0
|\ \ \ | |/ / |/| | Clean up unused method for `rake doc`.
| * | Clean up unused method for `rake doc`.Teng Siong Ong2013-05-111-5/+0
|/ /
* | Merge branch 'fix-json-encoding'Rafael Mendonça França2013-05-103-5/+18
|\ \ | | | | | | | | | | | | | | | This is the compination of #10057 and 10534. Closes #10320
| * | Give credits to all the envolved people [ci skip]Rafael Mendonça França2013-05-101-1/+1
| | |
| * | Merge pull request #10534 from cmaruz/masterRafael Mendonça França2013-05-103-3/+12
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Escape of U+2028 and U+2029 in the JSON Encoder Conflicts: activesupport/lib/active_support/json/encoding.rb
| | * | Added escaping of U+2028 and U+2029 inside the json encoder.Mario Caropreso2013-05-093-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | U+2028 and U+2029 are allowed inside strings in JSON (as all literal Unicode characters) but JavaScript defines them as newline seperators. Because no literal newlines are allowed in a string, this causes a ParseError in the browser. We work around this issue by replacing them with the escaped version. The resulting JSON is still valid and can be parsed in the browser. This commit has been coauthored with Viktor Kelemen @yikulju
| * | | Fix syntax error on Ruby 2.0Rafael Mendonça França2013-05-101-2/+4
| | | | | | | | | | | | | | | | | | | | Since Ruby 2.0 is UTF-8 by default we need to explictly say that the encoding of this file is US-ASCII
| * | | Merge pull request #10057 from zackham/patch-1Rafael Mendonça França2013-05-101-2/+4
|/| | | | | | | | | | | | | | | Escape multibyte line terminators in JSON encoding
| * | | Escape multibyte line terminators in JSON encodingzackham2013-04-021-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, json/encoding respects the JSON spec (as it should) which disallows \n and \r inside strings, escaping them as expected. Unfortunately, ECMA-262 (Javascript) disallows not only \n and \r in strings, but "Line Terminators" which includes U+2028 and U+2029. See here: http://bclary.com/2004/11/07/#a-7.3 This pull request adds U+2028 and U+2029 to be escaped. # Why?  It's very common to see something like this in a Rails template: <script type="text/javascript">  var posts = <%= @posts.to_json %>; </script> If U+2028 or U+2029 are part of any attributes output in the to_json call, you will end up with an exception. In Chrome: Uncaught SyntaxError: Unexpected token ILLEGAL  # Why not? This is JSON encoding, and the JSON spec is specific about how to  encode strings. U+2028 and U+2029 don't get special treatment. Just trying to start a discussion... what do you do in your apps to deal with this? Is there a convention I'm missing?
* | | | Merge pull request #10558 from Empact/cleanup-finder-methodsRafael Mendonça França2013-05-104-28/+25
|\ \ \ \ | | | | | | | | | | Cleanup finder methods
| * | | | Extract JoinDependency#join_relation to DRY the repeated application of the ↵Ben Woosley2013-05-103-7/+9
| | | | | | | | | | | | | | | | | | | | #join_associations.
| * | | | In #apply_join_dependency, we can apply the #where in-place because relation ↵Ben Woosley2013-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is always a new object. Thanks to the #except we call at the top of the method.
| * | | | DRY-up join dependency creation by extracting construct_join_depdencyBen Woosley2013-05-101-7/+5
| | | | |
| * | | | Pull the excepts into apply_join_dependency, for the sake of DRY.Ben Woosley2013-05-101-3/+4
| | | | |
| * | | | Simplify conditions within apply_join_dependencyBen Woosley2013-05-101-9/+5
| | | | |
| * | | | Move the except(:select) inside the construct_limited_ids_condition method ↵Ben Woosley2013-05-101-2/+2
| | | | | | | | | | | | | | | | | | | | to pair it closely with its motivation.
| * | | | Reject blank order_values within #columns_for_distinct, as the orders aren't ↵Ben Woosley2013-05-102-3/+3
|/ / / / | | | | | | | | | | | | used at all on non-postgres adapters.
* | | | Move #proxy_association method to AssociationRelationJon Leighton2013-05-103-4/+6
| | | |
* | | | Merge pull request #6792 from Empact/postgres-distinctJon Leighton2013-05-105-12/+61
|\ \ \ \ | | | | | | | | | | Fix that #exists? can produce invalid SQL: "SELECT DISTINCT DISTINCT"
| * | | | Fix that #exists? can produce invalid SQL: "SELECT DISTINCT DISTINCT"Ben Woosley2013-05-105-12/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The combination of a :uniq => true association and the #distinct call in #construct_limited_ids_condition combine to create invalid SQL, because we're explicitly selecting DISTINCT, and also sending #distinct on to AREL, via the relation#distinct_value. Rather than build a select distinct clause in #construct_limited_ids_condition, I set #distinct! and pass just the columns into the select statement. This requires introducing a #columns_for_distinct method to return the select columns but not the statement itself.
* | | | | Merge pull request #10553 from dasch/dasch/dont-try-to-explain-select_dbXavier Noria2013-05-102-1/+6
|\ \ \ \ \ | | | | | | | | | | | | Don't try to EXPLAIN select_db calls
| * | | | | Don't try to EXPLAIN select_db callsDaniel Schierbeck2013-05-102-1/+6
|/ / / / /
* | | | | Merge pull request #10543 from vipulnsward/to_sortCarlos Antonio da Silva2013-05-101-1/+1
|\ \ \ \ \ | | | | | | | | | | | | Can you improve the commit message a little bit? It's good to describe why the change is happening.
| * | | | | sort => sort! on new arrayVipul A M2013-05-101-1/+1
| | | | | |
* | | | | | Set the inverse when association queries are refinedJon Leighton2013-05-104-1/+33
| |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suppose Man has_many interests, and inverse_of is used. Man.first.interests.first.man will correctly execute two queries, avoiding the need for a third query when Interest#man is called. This is because CollectionAssociation#first calls set_inverse_instance. However Man.first.interests.where("1=1").first.man will execute three queries, even though this is obviously a subset of the records in the association. This is because calling where("1=1") spawns a new Relation object from the CollectionProxy object, and the Relation has no knowledge of the association, so it cannot set the inverse instance. This commit solves the problem by making relations spawned from CollectionProxies return a new Relation subclass called AssociationRelation, which does know about associations. Records loaded from this class will get the inverse instance set properly. Fixes #5717. Live commit from La Conf! :sparkles:
* | | | | Merge pull request #10510 from think602/masterXavier Noria2013-05-091-0/+1
|\ \ \ \ \ | |/ / / / |/| | | | [ci skip] document protect_against_forgery? method
| * | | | [ci skip] document protect_against_forgery? methodWeston Platter2013-05-101-0/+1
| | | | |
* | | | | Merge pull request #10535 from vipulnsward/remove_varCarlos Antonio da Silva2013-05-091-1/+0
|\ \ \ \ \ | | | | | | | | | | | | remove redundant var
| * | | | | remove redundant varVipul A M2013-05-091-1/+0
| | | | | |
* | | | | | Merge pull request #10536 from vipulnsward/fix_exp_warningCarlos Antonio da Silva2013-05-091-1/+0
|\ \ \ \ \ \ | | | | | | | | | | | | | | remove variable and fix warning
| * | | | | | remove variable and fix warningVipul A M2013-05-091-1/+0
| |/ / / / /