- 29 4月, 2015 1 次提交
-
-
由 Shane Hender 提交于
-
- 20 4月, 2015 2 次提交
-
-
由 Rafael Mendonça França 提交于
This will avoid the indirection of having calling id since we already know which is the primary key column. Also this will make explicit the behavior since it is not clear that id gets the right primary key value and not just the value of the "id" column.
-
由 Mehmet Emin İNAÇ 提交于
Fixes #19776 change test variable names and use more verbose on method less verbose use _read_attribute instead of send
-
- 09 4月, 2015 1 次提交
-
-
由 Arthur Neves 提交于
[fixes #18606] Make belongs_to use touch over touch_later when running the callbacks. Add more tests and small method rename Thanks Jeremy for the feedback.
-
- 02 3月, 2015 1 次提交
-
-
由 Aaron Patterson 提交于
directly calling `sync_with_transaction_state` is not fast, so if we call it once, we can improve the performance of the `persisted?` method. This is important because every call to `url_for(model)` will call `persisted?`, so we want that to be fast. Here is the benchmark: ```ruby require 'active_record' ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:" ActiveRecord::Base.connection.instance_eval do create_table(:articles) end class Article < ActiveRecord::Base; end article = Article.new.tap(&:save!) Benchmark.ips do |x| x.report("persisted?") do article.persisted? end end ``` Before this patch: ``` $ bundle exec ruby -rbenchmark/ips persisted.rb Calculating ------------------------------------- persisted? 3.333k i/100ms ------------------------------------------------- persisted? 51.037k (± 8.2%) i/s - 253.308k ``` After: ``` $ bundle exec ruby -rbenchmark/ips persisted.rb Calculating ------------------------------------- persisted? 7.172k i/100ms ------------------------------------------------- persisted? 120.730k (± 5.1%) i/s - 602.448k ```
-
- 18 2月, 2015 1 次提交
-
-
由 Hyonjee Joo 提交于
Fixes #18905. `#touch` now takes time as an option. Setting the option saves the record with the updated_at/on attributes set to the current time or the time specified. Updated tests and documentation accordingly.
-
- 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
-
- 02 2月, 2015 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 23 1月, 2015 1 次提交
-
-
由 Santosh Wadghule 提交于
-
- 18 1月, 2015 1 次提交
-
-
由 Prathamesh Sonpatki 提交于
- This is based on https://github.com/rails/rails/issues/18400 but tackling same issue with update_attribute method instead of update method.
-
- 15 1月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
Building the Arel AST, and manipulating the relation manually like this is prone to errors and breakage as implementation details change from underneath it.
-
- 03 1月, 2015 1 次提交
-
-
由 claudiob 提交于
Before this commit, returning `false` in an ActiveRecord `before_` callback such as `before_create` would halt the callback chain. After this commit, the behavior is deprecated: will still work until the next release of Rails but will also display a deprecation warning. The preferred way to halt a callback chain is to explicitly `throw(:abort)`.
-
- 30 12月, 2014 1 次提交
-
-
由 claudiob 提交于
ActiveRecord::Base `save` and `save!` take an option boolean `:touch` parameter since #18225 (stems from #18202). This commit document that parameter. [ci skip]
-
- 28 12月, 2014 1 次提交
-
-
由 Dan Olson 提交于
-
- 25 12月, 2014 1 次提交
-
-
由 Zachary Scott 提交于
-
- 04 12月, 2014 1 次提交
-
-
由 Yves Senn 提交于
[ci skip] This is due to the fact that `.delete` is directly translated to SQL. It tries to follow the same rules as `.delete_all` which is not able to verify that records are `#readonly?`.
-
- 28 11月, 2014 1 次提交
-
-
由 Yuki Nishijima 提交于
Since 3e30c5d4, it started ignoring the given error message. This commit changes the behavior of AR::RecordNotSaved#initialize so that it no longer loses the given error message.
-
- 26 11月, 2014 1 次提交
-
-
由 Recursive Madman 提交于
This allows these exceptions to be handled generically in conjunction with RecordInvalid.
-
- 18 11月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
Oh hey, we got to remove some code because of that!
-
- 15 11月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
This reverts commit 8fee9238. Conflicts: activerecord/lib/active_record/attribute_set/builder.rb This solution sucks, and is hard to actually apply across the board. Going to try other solutions
-
- 07 11月, 2014 1 次提交
-
-
由 Franky W 提交于
Currently, there is no messages which get printed out. Convoluted system may have hooks that create other objects in which case we only fail with no messages. This commit changes this information allowing you to know which object is the one that actually raised the error.
-
- 06 11月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
We introduced a performance hit by adding an additional iteration through a model's attributes on creation. We don't actually need the values from `Result` to be a hash, we can separate the columns and values and zip them up ourself during the iteration that we have to do.
-
- 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.
-
- 17 8月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
-
- 11 8月, 2014 1 次提交
-
-
由 lsylvester 提交于
-
- 08 8月, 2014 1 次提交
-
-
由 Zachary Scott 提交于
`#create!` regarding validations in contrast to the behavior of `#create`. Also describe creating multiple objects using an array of hashes as the +attributes+ parameter. [ci skip] /cc #16384
-
- 07 8月, 2014 1 次提交
-
-
由 Tom Kadwill 提交于
-
- 05 8月, 2014 1 次提交
-
-
由 Bogdan Gusiev 提交于
-
- 04 7月, 2014 1 次提交
-
-
由 Matthew Draper 提交于
-
- 23 6月, 2014 2 次提交
-
-
由 Sean Griffin 提交于
This was used more previously, but other uses have been removed.
-
由 Sean Griffin 提交于
`reload` is meant to put a record in the same state it would be if you were to do `Post.find(post.id)`. This means we should fully replace the attributes hash.
-
- 20 6月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
Mostly delegation to start, but we can start moving a lot of behavior in bulk to this object.
-
- 14 6月, 2014 2 次提交
-
-
由 Sean Griffin 提交于
-
由 Sean Griffin 提交于
There's a lot more that can be moved to these, but this felt like a good place to introduce the object. Plans are: - Remove all knowledge of type casting from the columns, beyond a reference to the cast_type - Move type_cast_for_database to these objects - Potentially make them mutable, introduce a state machine, and have dirty checking handled here as well - Move `attribute`, `decorate_attribute`, and anything else that modifies types to mess with this object, not the columns hash - Introduce a collection object to manage these, reduce allocations, and not require serializing the types
-
- 11 6月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
We never want result types to override column types, and `decorate_columns` can only affect column types. No need to go through the decoration multiple times, we can just exclude the column types from the result types instead.
-
- 07 6月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
Reduces the number of things outside of attribute methods that cares about the details of how we store and type cast attributes
-
- 04 6月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
`@raw_attributes` should not contain the type-cast, mutable version of the value.
-
- 02 6月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
-
- 31 5月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
`@attributes` was actually used for `_before_type_cast` and friends, while `@attributes_cache` is the type cast version (and caching is the wrong word there, but I'm working on removing the conditionals around that). I opted for `@raw_attributes`, because `_before_type_cast` is also semantically misleading. The values in said hash are in the state given by the form builder or database, so raw seemed to be a good word.
-
- 20 5月, 2014 1 次提交
-
-
由 Yves Senn 提交于
Closes #15122 Closes #15107
-