aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #15976 from sgrif/sg-attribute-existsGodfrey Chan2014-06-291-2/+7
|\ | | | | Don't encourage usage of `columns_hash`
| * Don't encourage usage of `columns_hash`Sean Griffin2014-06-291-2/+7
| | | | | | | | | | | | | | | | | | As discussed in https://github.com/plataformatec/simple_form/pull/1094, we should not encourage usage of `columns_hash`, and instead provide an alternate method to determine whether or not an attribute exists. The language `attribute` was chosen over `column` since these are in the `AttributeMethods` module.
* | Merge pull request #15982 from sgrif/sg-attr-set-map-valuesGodfrey Chan2014-06-292-7/+4
|\ \ | | | | | | Use `Hash#transform_values` to clean up `AttributeSet`
| * | Use `Hash#transform_values` to clean up `AttributeSet`Sean Griffin2014-06-292-7/+4
| |/
* / Use the type object for sending JSON to the databaseSean Griffin2014-06-294-23/+11
|/
* Always pass a column with a type object to quoteSean Griffin2014-06-288-28/+25
| | | | | | | | The only case where we got a column that was not `nil`, but did not respond to `cast_type` was when type casting the default value during schema creation. We can look up the cast type, and add that object to the column definition. Will allow us to consistently rely on the type objects for type casting in all directions.
* [Postgresql tests] remove duplicate helperAbdelkader Boudih2014-06-281-12/+3
|
* MySQL doesn't work with foreign keysPhilippe Creux2014-06-271-1/+4
| | | | | | This was previously fixed in e84799d but broken in 3f596f8. This commit reintroduced the conditional that prevents the foreign keys from being added to MySQL databases.
* Fix test with add_foreign_key DSL in 9d21ef9Philippe Creux2014-06-271-1/+1
|
* Merge pull request #15934 from seuros/renameRafael Mendonça França2014-06-273-3/+17
|\ | | | | | | rename primary key sequence only if it exists
| * rename sequence only if it existsAbdelkader Boudih2014-06-273-3/+17
| |
* | Do not change the global state of the test suiteRafael Mendonça França2014-06-272-18/+2
| |
* | Improve tests to use add_foreign_key DSLRafael Mendonça França2014-06-271-18/+11
| |
* | MySQL doesn't works with foreign keyRafael Mendonça França2014-06-271-3/+2
|/
* Merge pull request #12450 from iantropov/masterRafael Mendonça França2014-06-275-5/+59
|\ | | | | | | | | | | | | | | | | Fix bug, when ':dependent => :destroy' violates foreign key constraints Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/associations/builder/association.rb activerecord/lib/active_record/associations/builder/has_one.rb
| * Fix bug, when ':dependent => :destroy' option violates foreign key ↵Ivan Antropov2013-10-265-9/+61
| | | | | | | | constraints, issue #12380
* | Merge pull request #15788 from sgrif/sg-mutable-stringsRafael Mendonça França2014-06-275-13/+77
|\ \ | | | | | | | | | Detect in-place modifications on Strings
| * | Detect in-place modifications on StringsSean Griffin2014-06-174-13/+55
| | |
* | | Merge pull request #8639 from bogdan/valid-with-bangRafael Mendonça França2014-06-273-1/+36
|\ \ \ | | | | | | | | | | | | Add AR::Base#valid! method
| * | | Add AR::Base#validate! methodBogdan Gusiev2014-06-232-1/+31
| | | | | | | | | | | | | | | | | | | | Acts same as valid? but raises AR::RecordInvalid exception if validation fails
* | | | Merge pull request #15940 from DNNX/databases-rake-refactoringRafael Mendonça França2014-06-273-31/+37
|\ \ \ \ | | | | | | | | | | databases.rake refactoring
| * | | | Use AR::SchemaMigration.table_exists? call instead of longish AR::Base...etc,etcViktar Basharymau2014-06-271-1/+1
| | | | |
| * | | | Extract AR::SchemaMigration.normalized_versions methodViktar Basharymau2014-06-272-2/+5
| | | | |
| * | | | db:migrate:status refactoring: Rewrite hand-crafted SQL query with ↵Viktar Basharymau2014-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | ActiveRecord#pluck
| * | | | Use Array#flat_map and Array#grep in db:migrate:status taskViktar Basharymau2014-06-271-10/+10
| | | | | | | | | | | | | | | | | | | | It allows the code to be more declarative and elegant.
| * | | | Add explaining variables to db:migrate:statusViktar Basharymau2014-06-271-2/+2
| | | | |
| * | | | Replace String index juggling with Pathname goodness in db:fixtures:loadViktar Basharymau2014-06-271-1/+1
| | | | |
| * | | | db:fixtures:load refactoring: remove unnecessary loopViktar Basharymau2014-06-271-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | `ActiveRecord::FixtureSet.create_fixtures` can accept an array of fixture_files.
| * | | | Extract `fixture_files` variable in fixtures:load rake taskViktar Basharymau2014-06-271-1/+7
| | | | |
| * | | | Replace a bit of cryptic code in fixtures:load rake task with plain stupid RubyViktar Basharymau2014-06-271-1/+5
| | | | |
| * | | | Get rid of duplication in db:fixtures:{identify,load}Viktar Basharymau2014-06-272-12/+7
| | | | |
| * | | | db:fixtures:{identify,load} tasks respect AR::Tasks::DatabaseTasks.rootViktar Basharymau2014-06-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, if `ENV['FIXTURES_PATH']` was set, then `Rails.root` was used, otherwise the app used `ActiveRecord::Tasks::DatabaseTasks.root`. Now it is consistent.
| * | | | Simplify complex code in databases.rakeViktar Basharymau2014-06-271-2/+2
| | | | |
* | | | | Stop using instance exec for type decoratorsSean Griffin & Sean Doyle2014-06-273-17/+38
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are moving this behavior out to an object that we would like to keep separated from `ActiveRecord::Base`, which means not passing the class object to it. As such, we need to stop using `instance_exec`, and instead close over the subclass on global type decorators that are applied in `Base`.
* | | | credit Matthew Higgins for the integration of foreign keys. [ci skip]Yves Senn2014-06-271-0/+3
| | | |
* | | | Change method visibilityRafael Mendonça França2014-06-261-2/+2
| | | |
* | | | Add nodoc to internal class [ci skip]Rafael Mendonça França2014-06-261-1/+1
| | | |
* | | | fk: add docsYves Senn2014-06-262-0/+70
| | | |
* | | | fk: review corrections: indent, visibility, syntax, wording.Yves Senn2014-06-265-52/+53
| | | |
* | | | fk: use random digest namesYves Senn2014-06-268-33/+59
| | | | | | | | | | | | | | | | | | | | | | | | The name of the foreign key is not relevant from a users perspective. Using random names resolves the urge to rename the foreign key when the respective table or column is renamed.
* | | | fk: raise for invalid :on_update / :on_delete valuesYves Senn2014-06-262-3/+18
| | | |
* | | | fk: `add/remove_foreign_key` are noop for adapters that don't support fkYves Senn2014-06-262-0/+28
| | | |
* | | | fk: dump foreign keys at the bottom to make sure tables exist.Yves Senn2014-06-262-6/+16
| | | |
* | | | fk: raise when identifiers are longer than `allowed_index_name_length`.Yves Senn2014-06-262-1/+14
| | | |
* | | | fk: support for on_updateYves Senn2014-06-267-19/+46
| | | |
* | | | fk: rename `dependent` to `on_delete`Yves Senn2014-06-267-27/+26
| | | |
* | | | fk: infere column name from table names.Yves Senn2014-06-264-7/+46
| | | | | | | | | | | | | | | | This allows to create and remove foreign keys without specifying a column.
* | | | fk: make `add_foreign_key` reversible.Yves Senn2014-06-263-1/+55
| | | |
* | | | fk: support dependent option (:delete, :nullify and :restrict).Yves Senn2014-06-267-4/+83
| | | |
* | | | fk: dump foreign keys to schema.rbYves Senn2014-06-264-2/+43
| | | | | | | | | | | | | | | | respect `table_name_prefix` and `table_name_suffix`.