aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
Commit message (Collapse)AuthorAgeFilesLines
* I added this feature so that a Map of changed fields could be retrievedJosh Sharpe2009-08-311-2/+9
| | | | | | | | | | | | | | | | | | | | after a model had been saved. This is useful in the after_save callback when you need to know what fields changed. At present there is no way to do this other than have code in the before_save callback that takes a copy of the changes Map, which I thought was a bit messy. Example. person = Person.find_by_name('bob') person.name = 'robert' person.changes # => {'name' => ['bob, 'robert']} person.save person.changes # => {} person.previous_changes # => {'name' => ['bob, 'robert']} person.reload person.previous_changes # => {} Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Don't use AR::Base.connection for fixture column quoting. Use the connection ↵Jeffrey Hardy2009-08-261-7/+9
| | | | | | | | given to Fixtures.new [#3104 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* allow ActiveRecord#RecordInvalid exception message to be localizedSven Fuchs2009-08-262-1/+3
| | | | | | [#2754 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Remove support for SQLite 2.Pratik Naik2009-08-172-42/+3
| | | | If you're still using it, please install the plugin from git://github.com/rails/sqlite2_adapter.git
* Fix calculation tests on sqlite2 [#3053 state:resolved]Jay Pignata2009-08-151-1/+1
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Break up concerns for choosing what attributes should be serialized and the ↵Joshua Peek2009-08-133-64/+49
| | | | actual serializer
* Remove unnecessary scoping for creating hm:t join recordPratik Naik2009-08-101-3/+4
|
* Remove unnecessary scoping and validation checks from hm:t#createPratik Naik2009-08-101-1/+1
|
* Unify hm:t#create and create! implementationPratik Naik2009-08-101-17/+13
|
* Extract common dirty tracking methods in AMoJoshua Peek2009-08-101-114/+9
|
* AMo overrides alias_attribute and manages aliasing all known attribute ↵Joshua Peek2009-08-101-17/+0
| | | | method matchers
* Use table prefix and suffix for schema_migrations index.Tim Peters2009-08-091-1/+1
| | | | | | [#1543 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Introduce validates_with to encapsulate attribute validations in a class.Jeff Dean2009-08-091-0/+68
| | | | | | [#2630 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* PostgreSQL: XML datatype supportLeonardo Borges2009-08-092-13/+36
| | | | | | [#1874 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* raises an exception on habtm join table inserts if join table contains a ↵Jaime Bellmyer2009-08-091-2/+14
| | | | | | | | primary key. Caches this check to save time on subsequent inserts. [#2086 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* raises exception (ActiveRecord::ConfigurationError with message) on habtm ↵Jaime Bellmyer2009-08-095-0/+36
| | | | | | association creation if join table contains a primary key Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix that creating a table whose primary key prefix type is :table_name ↵Morgan Schweers2009-08-091-1/+1
| | | | | | | | generates an incorrectly pluralized primary key. [#872 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix that counter_cache breaks with has_many :dependent => :nullify.Gabe da Silveira2009-08-091-0/+1
| | | | | | [#1196 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* AR should respect default values for MySQL BINARY and VARBINARY columns.Jatinder Singh2009-08-091-2/+2
| | | | | | [#1273 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* has_many :through create should not raise validation errorsrailsbob2009-08-091-1/+5
| | | | | | [#2934 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Allow ho:through#build when the owner is a new record [#1749 state:resolved]Tristan Dunn2009-08-101-3/+9
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Prevent overwriting of table name in merging SQL conditions [#2949 ↵Tristan Dunn2009-08-101-1/+3
| | | | state:resolved]
* Enable has_many :through for going through a has_one association on the join ↵Gabe da Silveira2009-08-103-4/+31
| | | | | | model [#2719 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Model#human_attribute_name now accept symbols [#3025 status:resolved]Arthur Zapparoli2009-08-091-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Make sure association conditions work with :include and :joins [#358 ↵Vladimir Meremyanin2009-08-091-3/+5
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* No longer require database name for MySQL to allow cross database selects.Tristan Dunn2009-08-091-6/+1
| | | | | | [#1122 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Added back support for destroying an association's object by id. [#2306 ↵Joshua Nichols2009-08-091-0/+1
| | | | | | status:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* With multiparameter date attributes, the behaviour when empty fields are ↵Hugo Peixoto2009-08-091-5/+9
| | | | | | | | present is now coherent with the one described in the date_select documentation. [#1715 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* validate uniqueness with limit in utf8Elise Huard2009-08-091-1/+1
| | | | | | [#2653 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Allow connect_timeout, read_timeout and write_timeout settings for MySQL ↵Matt Conway2009-08-091-0/+4
| | | | | | [#2544 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ensure hm:t#find does not assign nil to :include [#1845 state:resolved]railsbob2009-08-091-1/+1
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Serialized attributes should only be saved with partial_updates when the ↵Mike Breen2009-08-091-1/+1
| | | | | | serialized attribute is present [#2397 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Changed to use klass instead of constantizing in assign_ids generated methodDmitry Ratnikov2009-08-091-1/+1
| | | | | | [#260 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix for nested :include with namespaced models.Rich Bradley2009-08-091-1/+1
| | | | [#260 state:committed]
* Don't define a default primary key in the schema dumper.Tristan Dunn2009-08-081-1/+0
| | | | | | [#1908 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Adding :from scoping to ActiveRecord calculationsMatt Duncan2009-08-091-0/+2
| | | | | Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1229 state:committed]
* Ensure hm:t#create/create! throws ActiveRecord::RecordNotSaved when the ↵Pratik Naik2009-08-081-0/+4
| | | | owner is new
* DRY migration's rollback/forward methodsPratik Naik2009-08-081-14/+15
|
* Add rake db:forward - opposite of db:rollback [#768 state:resolved]Cristi Balan2009-08-081-0/+10
| | | | | | | | Example: rake db:forward # performs the next migration rake db:forward STEP=4 # performs the next 4 migrations Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ruby 1.9.2: Object#id is gone nowJeremy Kemper2009-08-071-1/+1
|
* Add destroyed? to ActiveRecord, include tests for polymorphic urls for ↵José Valim2009-08-071-0/+7
| | | | destroyed objects and refactor mime responds tests and documentation.
* Ruby 1.9.2 compat: Array#* uses to_str instead of to_s to join values since ↵Akira Matsuda2009-08-051-2/+1
| | | | | | | | Ruby 1.9.2 [#2959 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Revert "fallback_string_to_date sets Date._parse comp arg to true, so that ↵Geoff Buesing2009-08-051-1/+1
| | | | | | strings with two-digit years, e.g. '1/1/09', are interpreted as modern years" [#2019 state:wontfix] This reverts commit 55d1d12c32a1b99f3f07d2346b49a63650ba2e9d.
* Extract generic attribute method generation to AMoJoshua Peek2009-08-045-251/+15
|
* whitespaceJoshua Peek2009-08-041-5/+5
|
* Added reset_attribute! method to ActiveRecord::AttributeMethods::Dirty which ↵Paul Gillard2009-08-041-12/+29
| | | | | | will reset an attribute to its original value should it have changed. Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Modified ActiveRecord::AttributeMethods to allow classes to specify ↵Paul Gillard2009-08-044-41/+121
| | | | | | attribute method prefixes and/or suffixes. Previously only suffixes were allowed. Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Add simple support for ActiveModel's StateMachine for ActiveRecordJoshua Peek2009-08-041-0/+24
|
* fallback_string_to_date sets Date._parse comp arg to true, so that strings ↵Matt Ganderup2009-08-031-1/+1
| | | | with two-digit years, e.g. '1/1/09', are interpreted as modern years [#2019 state:resolved]
* quoted_date converts time-like objects to ↵Geoff Buesing2009-08-031-1/+6
| | | | ActiveRecord::Base.default_timezone before serialization. This allows you to use Time.now in find conditions and have it correctly be serialized as the current time in UTC when default_timezone == :utc [#2946 state:resolved]