Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Round usec when writing timestamp attribute. | kennyj | 2012-08-21 | 2 | -5/+29 |
| | |||||
* | Minor refactoring in Active Record model schema methods | Carlos Antonio da Silva | 2012-08-21 | 1 | -5/+3 |
| | | | | | | * Use each_key instead of generating intermediate keys array. * Use each_with_object instead of inject to build hash. * Use ternary to return instead of if + assignment. | ||||
* | removing dead code | Aaron Patterson | 2012-08-20 | 1 | -19/+7 |
| | |||||
* | define singleton methods rather than adding and removing methods | Aaron Patterson | 2012-08-20 | 1 | -45/+32 |
| | |||||
* | remove dead code | Aaron Patterson | 2012-08-20 | 1 | -78/+36 |
| | |||||
* | initialize instance variables for transactions to remove conditionals | Aaron Patterson | 2012-08-20 | 2 | -8/+7 |
| | |||||
* | This method is useless without a block, so remove test | Aaron Patterson | 2012-08-20 | 1 | -11/+9 |
| | |||||
* | remove unused variable | Aaron Patterson | 2012-08-20 | 1 | -1/+1 |
| | |||||
* | initialize instance variables to avoid conditionals | Aaron Patterson | 2012-08-20 | 1 | -2/+7 |
| | |||||
* | fix whitespace errors | Aaron Patterson | 2012-08-20 | 1 | -2/+2 |
| | |||||
* | Remove private verify readonly attr method | Carlos Antonio da Silva | 2012-08-19 | 1 | -5/+1 |
| | | | | | | | | | | This method was added to be shared between update_attribute and update_column in 50725cec397d4fa0ecf1dda4e6ae845a993f1ba7, but since update_attribute was removed, and update_column has changed to delegate to update_columns, the method is not used anywhere anymore. Also remove "key.to_s" conversion when raising readonly error, since the key is being interpolated. | ||||
* | Fix "last equality wins" logic in relation merge | Ernie Miller | 2012-08-19 | 2 | -14/+12 |
| | | | | | | This is a real fix (as compared to the band-aid in b127d86c), which uses the recently-added equality methods for ARel nodes. It has the side benefit of simplifying the merge code a bit. | ||||
* | Merge pull request #7377 from ↵ | Carlos Antonio da Silva | 2012-08-18 | 3 | -1/+11 |
|\ | | | | | | | | | brainopia/use_inversed_parent_for_first_and_last_child Use inversed parent for first and last child of has_many association | ||||
| * | Use inversed parent for first and last child of has_many association | brainopia | 2012-08-18 | 3 | -1/+11 |
| | | |||||
* | | Get rid of some arguments by using the accessors | Carlos Antonio da Silva | 2012-08-18 | 1 | -30/+31 |
| | | | | | | | | | | Cleans up a lot of noise from arguments being passed from one method to another. | ||||
* | | Move multiparameter attribute logic to a class | Carlos Antonio da Silva | 2012-08-18 | 1 | -72/+84 |
| | | | | | | | | | | This should make it easier to refactor and improve this code, and remove complexity with params going around here and there. | ||||
* | | Some more cleanup to use Hash#values_at, and some method docs | Carlos Antonio da Silva | 2012-08-18 | 1 | -3/+7 |
| | | |||||
* | | Use cached column information to instantiate time object | Carlos Antonio da Silva | 2012-08-18 | 1 | -6/+6 |
| | | |||||
* | | Refactor blank date parameter validation | Carlos Antonio da Silva | 2012-08-18 | 1 | -2/+6 |
| | | |||||
* | | Refactor missing parameter validation based on position | Carlos Antonio da Silva | 2012-08-18 | 2 | -8/+12 |
| | | |||||
* | | Reuse already fetched column to check for :time | Carlos Antonio da Silva | 2012-08-18 | 1 | -5/+6 |
| | | | | | | | | | | Avoid doing a new column lookup for the attribute, since we already have the column to check for the klass. | ||||
* | | Refactor some code in multiparameter assignment | Carlos Antonio da Silva | 2012-08-18 | 1 | -26/+25 |
| | | | | | | | | | | Move some methods to the top to better organize them, since they're used right at the beginning of the multiparameter assignment method chain. | ||||
* | | Extract nested parameter assignment to a separate method | Carlos Antonio da Silva | 2012-08-18 | 1 | -3/+6 |
|/ | |||||
* | Merge pull request #7380 from ↵ | Aaron Patterson | 2012-08-17 | 2 | -2/+21 |
|\ | | | | | | | | | ernie/fix-nomethoderror-on-non-attribute-equalities Fix merge error when Equality LHS is non-attribute | ||||
| * | Fix merge error when Equality LHS is non-attribute | Ernie Miller | 2012-08-17 | 2 | -2/+21 |
| | | | | | | | | | | | | | | | | | | This is at best a band-aid for a more proper fix, since it won't truly handle the removal of the previous equality condition of these other nodes. I'm planning to put in some work on ARel toward supporting that goal. Related: rails/arel#130, ernie/squeel#153, ernie/squeel#156 | ||||
* | | Pull more serialize code into a lazy included module | Jon Leighton | 2012-08-17 | 1 | -60/+63 |
| | | |||||
* | | don't call method unless we need to | Jon Leighton | 2012-08-17 | 1 | -1/+1 |
| | | |||||
* | | align them assignments | Jon Leighton | 2012-08-17 | 1 | -4/+4 |
| | | |||||
* | | Optimize for the happy path | Jon Leighton | 2012-08-17 | 1 | -11/+14 |
| | | | | | | | | | | | | Checking respond_to? incurs overhead, and most of the time when assigning attributes it will return true. So just handle the NoMethodError instead. | ||||
* | | Avoid #any? | Jon Leighton | 2012-08-17 | 1 | -1/+1 |
| | | | | | | | | | | | | any? will check that each item in the array is truthy, as opposed to !empty? which will simply check that the array has length. For an empty array, !empty? still seems to be faster than any? | ||||
* | | The default value can be set once in #column_defaults | Jon Leighton | 2012-08-17 | 2 | -9/+16 |
| | | | | | | | | Rather than doing it every time an instance is instantiated. | ||||
* | | Optimize instantiation for models which don't use serialize | Jon Leighton | 2012-08-17 | 1 | -13/+20 |
| | | | | | | | | Those z's were hard to type. | ||||
* | | Avoid deep_dup when intantiating. | Jon Leighton | 2012-08-17 | 1 | -2/+5 |
| | | | | | | | | | | deep_dup is slow. we only need to dup the values, so just do that directly. | ||||
* | | column default extraction should handle newlines. | Aaron Patterson | 2012-08-17 | 2 | -2/+10 |
| | | | | | | | | Fixes #7374 | ||||
* | | Merge pull request #7352 from aripollak/microsecond-timestamp | Rafael Mendonça França | 2012-08-17 | 4 | -3/+10 |
|\ \ | | | | | | | Fix occasional microsecond conversion inaccuracy | ||||
| * | | Fix occasional microsecond conversion inaccuracy | Ari Pollak | 2012-08-15 | 4 | -3/+10 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ActiveRecord::ConnectionAdapters::Column#microseconds did an unnecessary conversion to from Rational to float when calculating the integer number of microseconds. Some terminating decimal numbers in base10 are repeating decimal numbers in base2 (the format of float), and occasionally this causes a rounding error. Patch & explanation originally from Logan Bowers. | ||||
* | | | Increase benchmark time to 20 seconds. | Jon Leighton | 2012-08-17 | 1 | -18/+18 |
| |/ |/| | | | | | | | | | | | | | | | I think that 5 seconds was a bit low for our purposes. Also enable it to be configured via env vars. We also need to scale the number of records up/down depending on how long we're running the benchmark for. | ||||
* | | Use benchmark/ips to measure AR performance | Jon Leighton | 2012-08-17 | 1 | -39/+34 |
| | | | | | | | | | | | | This means we can more easily compare numbers, and we don't have to specify a single N for all reports, which previously meant that some tests were running many more/fewer iterations than necessary. | ||||
* | | Renaming active_record_deprecated_finders to activerecord-deprecated_finders | Jon Leighton | 2012-08-17 | 6 | -11/+11 |
|/ | | | | For consistency with the other AR extension plugins we are creating. | ||||
* | Remove duplicated changelog entry [ci skip] | Carlos Antonio da Silva | 2012-08-15 | 1 | -6/+0 |
| | |||||
* | Move changelog entry to the top [ci skip] | Carlos Antonio da Silva | 2012-08-15 | 1 | -5/+4 |
| | |||||
* | Merge pull request #7133 from roshats/fix_update_all_with_blank_argument | Carlos Antonio da Silva | 2012-08-15 | 3 | -1/+11 |
|\ | | | | | | | Change Relation#update_all with blank argument to raise an ArgumentError instead of trying an update with empty fields. | ||||
| * | raise ArgumentError if list of attributes to change is empty in update_all | Roman Shatsov | 2012-08-14 | 3 | -1/+11 |
| | | |||||
* | | Restore state on create when ActiveRecord::RecordInvalid is raised | Dave Yeu | 2012-08-11 | 3 | -1/+23 |
| | | | | | | | | This fixes issue #3217. | ||||
* | | Sync CHANGELOGs [ci skip] | Rafael Mendonça França | 2012-08-11 | 1 | -3/+83 |
| | | |||||
* | | Added changelog entry for table name prefix fix [ci skip] | Wojciech Wnętrzak | 2012-08-11 | 1 | -0/+3 |
| | | |||||
* | | fixup guides in light of :dependent changes | Jon Leighton | 2012-08-10 | 1 | -7/+7 |
| | | |||||
* | | Use method compilation for association methods | Jon Leighton | 2012-08-10 | 12 | -89/+86 |
| | | | | | | | | | | | | | | | | | | Method compilation provides better performance and I think the code comes out cleaner as well. A knock on effect is that methods that get redefined produce warnings. I think this is a good thing. I had to deal with a bunch of warnings coming from our tests, though. | ||||
* | | DRY up handling of dependent option | Jon Leighton | 2012-08-10 | 5 | -63/+22 |
| | | |||||
* | | Unprivatise all the things | Jon Leighton | 2012-08-10 | 7 | -170/+156 |
| | | | | | | | | | | | | Well, not all of them, but some of them. I don't think there's much reason for these methods to be private. |