Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Merge branch 'master' into adequaterecord | Aaron Patterson | 2014-04-20 | 1 | -2/+2 |
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (74 commits) [ci skip] builtin -> built-in Fix code indentation and improve formatting Grammar fix in Getting Started Guide Make URL escaping more consistent Optimize URI escaping Always escape string passed to url helper. Remove statement assuming coffee shop/public space wifi is inherently insecure Don't rely on Arel master in bug report template [ci skip] wrap methods in backticks [ci skip] "subhash" --> "sub-hash" multibyte_conformance.rb --> multibyte_conformance_test.rb Fix inconsistent behavior from String#first/#last `@destroyed` should always be set to `false` when an object is duped. remove warning `warning: ambiguous first argument; put parentheses or even spaces` :uglify -> :uglifier Regression test for irregular inflection on has_many Singularize association names before camelization Fix spelling and proper nouns Optimize select_value, select_values, select_rows and dry up checking whether to exec with cache for Postgresql adapter Include default rails protect_from_forgery with: :exception ... Conflicts: activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb | ||||
| * | Singularize association names before camelization | Javier Goizueta | 2014-04-18 | 1 | -2/+2 |
| | | | | | | | | So that irregular multi-word pluralization rules have to be defined only for snake-case strings. | ||||
* | | oops. should probably double check in the DCL | Aaron Patterson | 2014-04-14 | 1 | -1/+3 |
| | | |||||
* | | cache scope building on associations | Aaron Patterson | 2014-04-14 | 1 | -0/+9 |
|/ | | | | SQL statements for querying associations are now cached | ||||
* | Only call uniq on the conditional that actually needs it | Carlos Antonio da Silva | 2014-04-09 | 1 | -1/+1 |
| | |||||
* | Remove extra collect call | Carlos Antonio da Silva | 2014-04-09 | 1 | -1/+1 |
| | |||||
* | Make the aggregate_reflections cache work with strings as its keys. | Lauro Caetano | 2014-04-09 | 1 | -2/+2 |
| | |||||
* | No need to call `to_sym` on reflection name, since the cache now works | Lauro Caetano | 2014-04-09 | 1 | -2/+2 |
| | | | | | | with strings with string keys. Related #14668. | ||||
* | Make the reflections cache work with strings as its keys. | Lauro Caetano | 2014-04-09 | 1 | -2/+2 |
| | |||||
* | The `source` option for `has_many => through` should accept String | Lauro Caetano | 2014-04-09 | 1 | -1/+1 |
| | | | | | | | | values. With the changes introduced by 16b70fddd4dc7e7fb7be108add88bae6e3c2509b it was expecting the value to be a Symbol, while it could be also a String value. | ||||
* | Ensure we are returning either `true` or `false` for `#==` | Godfrey Chan | 2014-03-29 | 1 | -1/+1 |
| | | | | | | 460eb83d cused `ActiveRecord::Base#==` to sometimes return `nil` in some cases, this ensures we always return a boolean value. Also fixed a similar problem in AR reflections. | ||||
* | scope_chain should not be mutated for other reflections | Neeraj Singh | 2013-10-14 | 1 | -1/+1 |
| | | | | | | | | | | | Currently `scope_chain` uses same array for building different `scope_chain` for different associations. During processing these arrays are sometimes mutated and because of in-place mutation the changed `scope_chain` impacts other reflections. Fix is to dup the value before adding to the `scope_chain`. Fixes #3882. | ||||
* | Fix the indentation | Rafael Mendonça França | 2013-10-08 | 1 | -12/+13 |
| | |||||
* | remove HABTM special cases from reflections | Aaron Patterson | 2013-10-02 | 1 | -14/+2 |
| | |||||
* | push constructable? on to the reflection | Aaron Patterson | 2013-10-02 | 1 | -0/+16 |
| | |||||
* | Remove conditional adding a new method | Rafael Mendonça França | 2013-09-11 | 1 | -5/+5 |
| | | | | | | At the point we want to add the reflection we already know the reflection is of the AggregateReflection type so we can call a specific method | ||||
* | support anonymous classes on has_many associations | Aaron Patterson | 2013-09-03 | 1 | -0/+1 |
| | |||||
* | pk should not be required for hm:t associations | Aaron Patterson | 2013-08-29 | 1 | -1/+0 |
| | |||||
* | Fixing multi-word automatic inverse detection. | wangjohn | 2013-08-15 | 1 | -2/+2 |
| | | | | | Currently, ActiveRecord models with multiple words cannot have their inverse associations detected automatically. | ||||
* | Revert "all `scope_chain` methods allocate new arrays, no need to dup" | Aaron Patterson | 2013-07-31 | 1 | -1/+1 |
| | | | | This reverts commit 1468a4b89aa4bca99160bfa03572b2c0ab348db5. | ||||
* | all `scope_chain` methods allocate new arrays, no need to dup | Aaron Patterson | 2013-07-30 | 1 | -1/+1 |
| | |||||
* | oops! | Aaron Patterson | 2013-07-23 | 1 | -1/+1 |
| | |||||
* | eliminate conditional in JoinHelper | Aaron Patterson | 2013-07-23 | 1 | -1/+1 |
| | |||||
* | acually get the actual source reflection :cry::gun: | Aaron Patterson | 2013-07-23 | 1 | -7/+14 |
| | |||||
* | factory methods should not have side effects. | Aaron Patterson | 2013-07-23 | 1 | -3/+1 |
| | | | | Move model mutation to the methods that are called on the model. | ||||
* | extract mutation from generation method | Aaron Patterson | 2013-07-23 | 1 | -3/+5 |
| | |||||
* | habtm can only ever be an association reflection | Aaron Patterson | 2013-07-22 | 1 | -2/+4 |
| | |||||
* | use the predicate method | Aaron Patterson | 2013-07-22 | 1 | -1/+1 |
| | |||||
* | AR::Base does not need to know how to create reflection objects | Aaron Patterson | 2013-07-22 | 1 | -19/+19 |
| | |||||
* | use the superclass implementation | Aaron Patterson | 2013-07-18 | 1 | -1/+3 |
| | |||||
* | quoted table name is also cached | Aaron Patterson | 2013-06-13 | 1 | -1/+1 |
| | |||||
* | table name is cached on the class, so stop caching twice | Aaron Patterson | 2013-06-13 | 1 | -1/+1 |
| | |||||
* | calculate types on construction | Aaron Patterson | 2013-06-13 | 1 | -8/+4 |
| | |||||
* | only cache the primary key column in one place | Aaron Patterson | 2013-06-13 | 1 | -1/+1 |
| | |||||
* | these methods are never called, so remove them | Aaron Patterson | 2013-06-13 | 1 | -8/+0 |
| | |||||
* | This test does not test anything that happens in the real world. If you | Aaron Patterson | 2013-06-13 | 1 | -7/+0 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | recreate the models without mucking with internal caches of the relation objects, then the test fails. For example: class Man < ActiveRecord::Base has_many :interests end class Interest < ActiveRecord::Base belongs_to :man end Then do this test: def test_validate_presence_of_parent_fails_without_inverse_of repair_validations(Interest) do Interest.validates_presence_of(:man) assert_no_difference ['Man.count', 'Interest.count'] do man = Man.create(:name => 'John', :interests_attributes => [{:topic=>'Cars'}, {:topic=>'Sports'}]) assert_not_predicate man.errors[:"interests.man"], :empty? end end end The test will fail. This is a bad test, so I am removing it. | ||||
* | oops. step away from the keyboard aaron. :cry: | Aaron Patterson | 2013-06-13 | 1 | -1/+1 |
| | |||||
* | fix caching of automatic inverse of. :bomb: | Aaron Patterson | 2013-06-13 | 1 | -1/+3 |
| | |||||
* | let the object stay in charge of internal cache invalidation | Aaron Patterson | 2013-06-13 | 1 | -7/+5 |
| | |||||
* | reduce automatic_inverse_of caching logic | Aaron Patterson | 2013-06-13 | 1 | -30/+16 |
| | |||||
* | active_record should always be set. Do or do not, there is no try | Aaron Patterson | 2013-06-13 | 1 | -1/+1 |
| | |||||
* | push ambiguous reflection warning down to reflection name calculation | Aaron Patterson | 2013-06-13 | 1 | -23/+28 |
| | |||||
* | clean up ivar assignment | Aaron Patterson | 2013-06-13 | 1 | -3/+2 |
| | |||||
* | Ambiguous reflections are on :through relationships are no longer supported. | Aaron Patterson | 2013-06-13 | 1 | -1/+27 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For example, you need to change this: class Author < ActiveRecord::Base has_many :posts has_many :taggings, :through => :posts end class Post < ActiveRecord::Base has_one :tagging has_many :taggings end class Tagging < ActiveRecord::Base end To this: class Author < ActiveRecord::Base has_many :posts has_many :taggings, :through => :posts, :source => :tagging end class Post < ActiveRecord::Base has_one :tagging has_many :taggings end class Tagging < ActiveRecord::Base end | ||||
* | sometimes singularize does not work, so we get a list of two strings. just ↵ | Aaron Patterson | 2013-06-12 | 1 | -1/+1 |
| | | | | uniq them | ||||
* | no need to cache hash lookups | Aaron Patterson | 2013-06-12 | 1 | -1/+1 |
| | |||||
* | split aggregates from association reflections to avoid is_a checks later | Aaron Patterson | 2013-06-12 | 1 | -5/+11 |
| | |||||
* | remove unnecessary is_a check | Aaron Patterson | 2013-06-12 | 1 | -2/+1 |
| | |||||
* | Getting rid of the +automatic_inverse_of: false+ option in associations in favor | wangjohn | 2013-06-08 | 1 | -7/+7 |
| | | | | | of using +inverse_of: false+ option. Changing the documentation and adding a CHANGELOG entry for the automatic inverse detection feature. | ||||
* | remove code duplication | Neeraj Singh | 2013-05-22 | 1 | -2/+3 |
| |