- 07 8月, 2016 3 次提交
-
-
由 Xavier Noria 提交于
-
由 Xavier Noria 提交于
-
由 Xavier Noria 提交于
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
-
- 15 3月, 2016 1 次提交
-
-
由 Aaron Ang 提交于
In this patch, all log-related stuff in `ActiveSupport::Dependencies` is removed because the logging is no longer useful.
-
- 28 1月, 2016 1 次提交
-
-
由 Sean Griffin 提交于
The commit which originally added this behavior did not consider that doing `Subclass.new` does not actually populate the `type` field in the attributes (though perhaps it should). We simply need to not use the defaults for STI related things unless we are instantiating the base class. Fixes #23285.
-
- 20 1月, 2016 2 次提交
-
-
由 Prathamesh Sonpatki 提交于
-
由 Yves Senn 提交于
Closes #21986. This makes it possible to write custom types that define a different mapping for STI columns.
-
- 03 12月, 2015 1 次提交
-
-
由 Yves Senn 提交于
This will also get the defaults from attribute definitions like: attribute :type, :string, default: "SomethingElse"
-
- 02 12月, 2015 1 次提交
-
-
由 Kuldeep Aggarwal 提交于
fixes #17121
-
- 31 10月, 2015 1 次提交
-
-
由 yui-knk 提交于
These methods are defined in inheritance.rb * `abstract_class?` * `descends_from_active_record?` * `compute_type`
-
- 27 10月, 2015 2 次提交
-
-
由 Rafael Mendonça França 提交于
This reverts commit 60c97012, reversing changes made to 6a25202d. Reason: Broken build
-
由 Matt Todd 提交于
This triggers the JoinDependency work to reflect on the associations and trigger an error as follows: ActiveRecord::ConfigurationError: Association named 'account' was not found on Company; perhaps you misspelled it? Fix Company.of_first_firm joins association name Should be `Company.joins(:accounts)` not `Company.joins(:account)`. Do the same for Client.of_first_firm
-
- 13 5月, 2015 1 次提交
-
-
由 Yves Senn 提交于
This can resolve confusing situation when a top level constant exists but a namespaced version is identified. Related to #19531.
-
- 11 5月, 2015 1 次提交
-
-
由 Alex Robbin 提交于
If your STI class looks like this: ```ruby class Company < ActiveRecord::Base self.store_full_sti_class = false class GoodCo < Company end class BadCo < Company end end ``` The expectation (which is valid) is that the `type` in the database is saved as `GoodCo` or `BadCo`. However, another expectation should be that setting `type` to `GoodCo` would correctly instantiate the object as a `Company::GoodCo`. That second expectation is what this should fix.
-
- 07 5月, 2015 1 次提交
-
-
由 Yves Senn 提交于
Make sure that tests do not hardcode the default value. For example `test_instantiation_doesnt_try_to_require_corresponding_file` always restored the configuration to `true` regardless of what it's original value was. Extract a helper to make the global modification consistent across tests.
-
- 04 2月, 2015 1 次提交
-
-
由 Miklos Fazekas 提交于
When ```becomes``` changes @attributes it should also change @changed_attributes. Otherwise we'll experience a kind of split head situation where attributes are coming from ```self```, but changed_attributes is coming from ```klass.new```. This affects the inheritance_colmn as it's changed by new for example. Fixes #16881
-
- 27 1月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
-
- 27 12月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
This will allow eager type casting to take place as needed. There doesn't seem to be any particular reason that the `in` statement was forced for single values, and the commit message where it was introduced gives no context. See https://github.com/rails/rails/commit/d90b4e2615e8048fdeffc6dffe3246704adee01f
-
- 19 11月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
We added a comparison to "id", and call to `self.class.primary_key` a *lot*. We also have performance hits from `&block` all over the place. We skip the check in a new method, in order to avoid breaking the behavior of `read_attribute`
-
- 29 9月, 2014 1 次提交
-
-
由 Ben Woosley 提交于
Isolate access to @associations_cache and @aggregations cache to the Associations and Aggregations modules, respectively. This includes replacing the `association_cache` accessor with a more limited `association_cached?` accessor and making `clear_association_cache` and `clear_aggregation_cache` private.
-
- 18 5月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
-
- 15 3月, 2014 1 次提交
-
-
由 Guo Xiang Tan 提交于
Follow-Up to https://github.com/rails/rails/pull/14348 Ensure that SQLCounter.clear_log is called after each test. This is a step to prevent side effects when running tests. This will allow us to run them in random order.
-
- 22 1月, 2014 1 次提交
-
-
由 Jason Meller 提交于
This commit fixes two regressions introduced in cafe31a0 where newly created finder methods #second, #third, #forth, and #fifth caused a NoMethodError error on reload associations and where we were pulling the wrong element out of cached associations. Examples: some_book.authors.reload.second # Before # => NoMethodError: undefined method 'first' for nil:NilClass # After # => #<Author id: 2, name: "Sally Second", ...> some_book.first.authors.first some_book.first.authors.second # Before # => #<Author id: 1, name: "Freddy First", ...> # => #<Author id: 1, name: "Freddy First", ...> # After # => #<Author id: 1, name: "Freddy First", ...> # => #<Author id: 2, name: "Sally Second", ...> Fixes #13783.
-
- 14 1月, 2014 1 次提交
-
-
由 Ujjwal Thaakar 提交于
The `subclass_from_attrs` method is called even if the column specified by the `inheritance_column` setting doesn't exist. This prevents setting associations via the attributes hash if the association name clashes with the value of the setting, typically `:type`. This worked previously in Rails 3.2.
-
- 13 1月, 2014 1 次提交
-
-
由 Yves Senn 提交于
-
- 04 1月, 2014 1 次提交
-
-
由 T.J. Schuck 提交于
-
- 04 10月, 2013 1 次提交
-
-
由 Prem Sichanugrist 提交于
Related issue: #11939, #12084
-
- 02 4月, 2013 1 次提交
-
-
由 Nate Berkopec 提交于
-
- 18 3月, 2013 1 次提交
-
-
由 Takehiro Adachi 提交于
These tests should be in inheritance_test.rb since its testing a feature which is implemented in inheritance.rb
-
- 11 3月, 2013 1 次提交
-
-
由 Takehiro Adachi 提交于
assertion for https://github.com/rails/rails/blob/ad624345e54bd20802de67b2b5c9ef29ecf5 d5f4/activerecord/lib/active_record/inheritance.rb#L32
-
- 06 3月, 2013 1 次提交
-
-
由 Dmitry Vorotilin 提交于
It cannot find subclass because all classes are loaded automatically when it needs.
-
- 29 11月, 2012 2 次提交
-
-
由 Carlos Antonio da Silva 提交于
-
由 Jason Rush 提交于
Allows you to do BaseClass.new(:type => "SubClass") as well as parent.children.build(:type => "SubClass") or parent.build_child to initialize an STI subclass. Ensures that the class name is a valid class and that it is in the ancestors of the super class that the association is expecting.
-
- 26 10月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
In the end I think the pain of implementing this seamlessly was not worth the gain provided. The intention was that it would allow plain ruby objects that might not live in your main application to be subclassed and have persistence mixed in. But I've decided that the benefit of doing that is not worth the amount of complexity that the implementation introduced.
-
- 04 9月, 2012 2 次提交
-
-
由 Yves Senn 提交于
All tests with a custom inheritance_column use the `Vegtable` model. The field ruby_type on the Company models is no longer needed
-
由 Yves Senn 提交于
previously the tests with and without a custom `inheritance_column` used the same models. Since the model then has both fields this can lead to false positives.
-
- 03 9月, 2012 1 次提交
-
-
由 Yves Senn 提交于
I had to create a new table because I needed an STI table, which does not have both a "type" and a "custom_type" the test fails with: 1) Error: test_alt_becomes_works_with_sti(InheritanceTest): NoMethodError: undefined method `type=' for #<Cabbage id: 1, name: "my cucumber", custom_type: "Cucumber"> /Users/username/Projects/rails/activemodel/lib/active_model/attribute_methods.rb:432:in `method_missing' /Users/username/Projects/rails/activerecord/lib/active_record/attribute_methods.rb:100:in `method_missing' /Users/username/Projects/rails/activerecord/lib/active_record/persistence.rb:165:in `becomes' test/cases/inheritance_test.rb:134:in `test_becomes_works_with_sti' test/cases/inheritance_test.rb:140:in `test_alt_becomes_works_with_sti'
-
- 03 8月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
On reflection, it seems like a bit of a weird method to have on ActiveRecord::Base, and it shouldn't be needed most of the time anyway.
-
- 28 7月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
It doesn't serve much purpose now that ActiveRecord::Base.all returns a Relation. The code is moved to active_record_deprecated_finders.
-
- 27 7月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
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 anyway.
-