aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
Commit message (Collapse)AuthorAgeFilesLines
* Simplify AR configuration code.Jon Leighton2012-06-151-4/+9
| | | | | Get rid of ActiveModel::Configuration, make better use of ActiveSupport::Concern + class_attribute, etc.
* Fix #6591. If a field with timezone isn't changed, we don't call will_change!.kennyj2012-06-041-1/+2
|
* force datetime attributes to be changed, fix GH #3965Sergey Nartimov2012-02-281-0/+1
|
* removing dead codeAaron Patterson2012-02-091-10/+0
|
* give each PG type a `type` method and decortate tz attributesAaron Patterson2012-02-071-1/+18
|
* moved most of the evald code in to regular ruby codeAaron Patterson2012-02-071-5/+2
|
* copy the columns hash to the active record instances, typecast using columns ↵Aaron Patterson2012-02-071-33/+46
| | | | looked up on the instance
* Support configuration on ActiveRecord::Model.Jon Leighton2011-12-281-3/+4
| | | | | | | | | | | | | | | The problem: We need to be able to specify configuration in a way that can be inherited to models that include ActiveRecord::Model. So it is no longer sufficient to put 'top level' config on ActiveRecord::Base, but we do want configuration specified on ActiveRecord::Base and descendants to continue to work. So we need something like class_attribute that can be defined on a module but that is inherited when ActiveRecord::Model is included. The solution: added ActiveModel::Configuration module which provides a config_attribute macro. It's a bit specific hence I am not putting this in Active Support or making it a 'public API' at present.
* Deal with global config better between AR::Base and AR::ModelJon Leighton2011-12-241-3/+2
|
* Fix #3837.Jon Leighton2011-12-031-11/+5
| | | | | We also need to time zone convert time zone aware attributes when accessed via read_attribute, not only when via direct access.
* Remove some unnecessary code etcJon Leighton2011-12-011-19/+3
|
* Remove the need for type_cast_attribute.Jon Leighton2011-12-011-3/+16
| | | | This is good because it reduces duplication.
* Don't rely on underscore-prefixed attribute methods.Jon Leighton2011-12-011-11/+15
| | | | | | Define singleton methods on the attributes module instead. This reduces method pollution on the actual model classes. It also seems to make something faster, I am unsure why! O_o
* Remove `#among?` from Active SupportPrem Sichanugrist2011-04-131-1/+1
| | | | | | After a long list of discussion about the performance problem from using varargs and the reason that we can't find a great pair for it, it would be best to remove support for it for now. It will come back if we can find a good pair for it. For now, Bon Voyage, `#among?`.
* Change Object#either? to Object#among? -- thanks to @jamesarosen for the ↵David Heinemeier Hansson2011-04-121-1/+1
| | | | suggestion!
* Using Object#in? and Object#either? in various placesPrem Sichanugrist2011-04-111-1/+2
| | | | There're a lot of places in Rails source code which make a lot of sense to switching to Object#in? or Object#either? instead of using [].include?.
* Fix before_type_cast for timezone aware attributes by caching converted ↵Adam Meehan2011-03-231-4/+5
| | | | value on write. Also remove read method reload arg on timezone attributes.
* avoid nil.dupAkira Matsuda2011-02-071-1/+1
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Make before_type_cast available for datetime fieldsAkira Matsuda2011-02-011-2/+3
| | | | | | [#3973 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* class inheritable attributes is used no more! all internal use of class ↵Josh Kalderimis2010-11-201-2/+4
| | | | | | inheritable has been changed to class_attribute. class inheritable attributes has been deprecated. Signed-off-by: José Valim <jose.valim@gmail.com>
* Cheaper attribute reads and respond_to?. Add underscore-prefixed method ↵Jeremy Kemper2010-09-091-2/+3
| | | | aliased to the attribute name so it can be overridden but still called internally.
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-1/+1
| | | | 's/[ \t]*$//' -i {} \;)
* ensuring that description does not exceed 100 columnsNeeraj Singh2010-08-021-1/+2
|
* fix stack trace lines on class_evalSantiago Pastorino2010-04-091-4/+4
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Revert "Refactoring attributes/types" [#3348 state:open]Pratik Naik2010-01-221-10/+38
| | | | | | | | | | | | | | | | | This reverts commit f936a1f100e75082081e782e5cceb272885c2df7. Conflicts: activerecord/lib/active_record.rb activerecord/lib/active_record/base.rb Revert "Fixed: #without_typecast should only disable typecasting on the duplicated attributes" [#3387 state:open] This reverts commit 2831996483c6a045f1f38d8030256eb58d9771c3. Reason : It's not generating attribute methods properly, making object.column 5x slower.
* Refactoring attributes/types [#3348 state:resolved]Eric Chapweske2009-10-171-38/+10
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Extract generic attribute method generation to AMoJoshua Peek2009-08-041-2/+2
|
* Modified ActiveRecord::AttributeMethods to allow classes to specify ↵Paul Gillard2009-08-041-2/+2
| | | | | | attribute method prefixes and/or suffixes. Previously only suffixes were allowed. Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Track generated attribute methods in a separate moduleJoshua Peek2009-08-021-2/+2
|
* Don't need to pass attr_name to evaluate_attribute_method anymoreJoshua Peek2009-07-301-2/+2
|
* Concernify AR AttributeMethodsJoshua Peek2009-07-301-0/+60