Yves Senn
77ed4d98a7
document id prefixed String usage of .find
. refs #12891 [ci skip]
2013-11-15 10:13:42 +01:00
Carlos Antonio da Silva
6b84de4575
Fix test name [ci skip]
2013-11-14 23:45:30 -02:00
Carlos Antonio da Silva
6cad0e317b
Fix AR Changelog examples and improve syntax highlight [ci skip]
2013-11-14 23:45:30 -02:00
David Heinemeier Hansson
07996ebc50
Revert "Used Yield instead of block.call" -- this causes all of atom_feed_helper_test.rb to fail with "SystemStackError: stack level too deep".
...
This reverts commit d3a1ce1cdc60d593de1682c5f4e3230c8db9a0fd.
2013-11-14 15:31:27 -08:00
David Heinemeier Hansson
421c81bd18
Fix that eager loading of polymorphic associations did not work with association empty?/any? predicates any more (there is still a problem when select is applied to a relation, or if you try association#exists? -- but its easier to work around)
2013-11-14 14:43:14 -08:00
Rafael Mendonça França
e15ea62b26
Merge pull request #12893 from javan/to-param-addendum
...
Addendum to #12891
2013-11-14 12:57:46 -08:00
Rafael Mendonça França
f33ab01b7e
Merge pull request #12819 from vipulnsward/also_dup_column_types
...
Also dup `column_types` in AR::Result `initialize_copy`
2013-11-14 12:42:23 -08:00
Javan Makhmali
633100b9e5
Addendum to #12891
...
* Fix incorrectly named tests
* Restore Object#to_param behavior
* Ensure param is derived from a squished and truncated string
2013-11-14 15:35:53 -05:00
Rafael Mendonça França
84961dc5df
Merge pull request #12889 from kuldeepaggarwal/speed_ups
...
Used Yield instead of block.call
2013-11-14 11:29:28 -08:00
Kuldeep Aggarwal
d3a1ce1cdc
Used Yield instead of block.call
2013-11-15 00:53:57 +05:30
Javan Makhmali
547999df25
Add AR::Base.to_param for convenient "pretty" URLs derived from a model's attribute or method.
2013-11-14 13:38:08 -05:00
Yves Senn
c576e24e0e
Merge pull request #12832 from vipulnsward/move_schema_creation
...
Move `SchemaCreation` to its own file instead of `AbstractAdapter`.
2013-11-14 00:52:11 -08:00
Guillermo Iguaran
93999edfd1
Merge pull request #12845 from amatsuda/should_ar_depend_on_rails
...
Refer to Rails.env from AR only when Rails is defined
2013-11-13 23:03:43 -08:00
Rafael Mendonça França
3d2e8cb71c
Merge pull request #12772 from dmathieu/no_touching
...
Add No Touching
2013-11-13 13:37:40 -08:00
Yves Senn
c994e10862
fix weird Emacs auto indentation. [ci skip]
2013-11-13 17:56:44 +01:00
Yves Senn
f081edb1fe
tests for merging Relations of different classes.
2013-11-13 17:41:26 +01:00
Yves Senn
742adce211
move Relation#merge tests into separate file.
2013-11-13 17:41:20 +01:00
Akira Matsuda
a99b81e44f
Ensure that a column added in a test is being removed after all
2013-11-13 19:21:40 +09:00
Damien Mathieu
b32ba367f5
add #no_touching on ActiveRecord models
2013-11-13 08:42:38 +01:00
Vipul A M
fc7129d27b
Move SchemaCreation
to its own file instead of AbstractAdapter
.
2013-11-12 18:50:12 +05:30
Ben Woosley
a7394a271b
Remove the unused, undocumented SQLite3Adapter#supports_count_distinct?
...
This has returned true since 3cc9b5f1, and is not used internally.
2013-11-12 00:52:25 -08:00
Ben Woosley
06c2b5bb5d
Drop a sqlite_version check because we only support SQLite 3.6.16 or newer.
...
Drop some comments that document the implementation rather than the interface.
2013-11-12 00:51:56 -08:00
dm1try
dbb7ee1bfd
Prevent the counter cache from being decremented twice
...
when destroying a record on a has_many :through association.
:destroy method has own counter_cache callbacks.
2013-11-11 19:53:02 +03:00
Yves Senn
07ae1e9b55
Unifies mysql and mysql2 casting of booleans.
2013-11-11 16:15:00 +01:00
Yves Senn
07790d5832
test cases to describe the MySQL boolean behavior.
2013-11-11 16:09:02 +01:00
Akira Matsuda
331c59f47c
Do not count "SHOW CREATE TABLE" queries when testing against mysql
2013-11-11 22:06:27 +09:00
Yves Senn
db56c0fcf5
tidy Active Record CHANGELOG. [ci skip].
2013-11-11 12:03:36 +01:00
Akira Matsuda
3ce9e43bc3
Avoid sorting an Array including objects from different Classes
...
addresses "ArgumentError: comparison of VerySpecialComment with SpecialComment failed" in ActiveRecord::DelegationRelationTest#test_#sort!_delegation_is_deprecated
2013-11-11 19:53:54 +09:00
Akira Matsuda
48b10134a5
Load test fixtures where data are needed
...
Without this, some tests here were not actually testing anything.
2013-11-11 19:53:54 +09:00
Yves Senn
f5802708db
Merge pull request #12834 from dredozubov/has_one_association_replacement
...
Fixes problem with replacing has_one association record with itself
2013-11-11 02:26:23 -08:00
Denis Redozubov
3ed5642e69
Fixes problem with replacing has_one association record with itself
2013-11-11 14:19:12 +04:00
Akira Matsuda
9222928dfb
A tiny grammatical fix
...
[ci skip]
2013-11-11 19:14:42 +09:00
Akira Matsuda
524d4a35d2
Refer to Rails.env only when Rails is defined
2013-11-11 18:55:06 +09:00
Anton Kalyaev
3fe97cb2b1
autoload ChangeColumnDefinition ( Fixes #12835 )
2013-11-11 11:52:03 +04:00
Rafael Mendonça França
98cff28d3f
Merge pull request #12749 from iantropov/issue_5303
...
Add test for ActiveRecord::Relation YAML serialization, for #5303 issue
2013-11-10 23:14:23 -02:00
Yves Senn
140c0c8881
use complete Relation API and not only Model.all.merge!
.
2013-11-09 22:02:46 +01:00
Carlos Antonio da Silva
2a8739dc6d
Change array check for better aesthetics / reading the code
2013-11-09 18:40:39 -02:00
Yves Senn
951348aec5
Merge pull request #12821 from arunagw/aa-removed-missleading-message
...
clarified missleading message
2013-11-09 12:09:06 -08:00
Yves Senn
849400c36d
improve Active Record Store docs when using PG types. [ci skip].
2013-11-09 21:05:28 +01:00
Arun Agrawal
539ce8b683
Changed message for Model.inspect
...
(No database connection) sounds not be
able to connect database.
see more #12804
2013-11-09 20:57:09 +01:00
Yves Senn
3bec1603f9
type casted PG bytea values are represented as a Hash.
...
This is a follow up to: 97f0d9a0dd12e7ad634815eecfeff866f64aad92
This change is also related to: df0edafac9eb47cd971970a9e7b13a3eaddf214e
2013-11-09 20:55:01 +01:00
Rafael Mendonça França
df0edafac9
Document the bind return
2013-11-09 17:51:26 -02:00
Rafael Mendonça França
aba688ed5c
Avoid shot circuit return.
...
This will make the conditional and to code clear
2013-11-09 17:51:25 -02:00
Vipul A M
f511eac2c1
Also dup column_types
in AR::Result initialize_copy
2013-11-10 00:25:57 +05:30
Carlos Antonio da Silva
5deec016fe
Improve changelogs formatting [ci skip]
2013-11-09 16:44:58 -02:00
Rafael Mendonça França
bdb8bc6e8a
Don't use Active Support where we don't need to
2013-11-09 16:40:00 -02:00
Carlos Antonio da Silva
2fd095507c
Fix typo in AR store docs [ci skip]
2013-11-09 16:12:38 -02:00
Yves Senn
97f0d9a0dd
log bind variables after they were type casted.
...
The log output used to be confusing in situation where type casting has
"unexpected" effects. For example when finding records with a `String`.
BEFORE:
irb(main):002:0> Event.find("im-no-integer")
D, [2013-11-09T11:10:28.998857 #1706 ] DEBUG -- : Event Load (4.5ms) SELECT "events".* FROM "events" WHERE "events"."id" = $1 LIMIT 1 [["id", "im-no-integer"]]
AFTER:
irb(main):002:0> Event.find("im-no-integer")
D, [2013-11-09T11:10:28.998857 #1706 ] DEBUG -- : Event Load (4.5ms) SELECT "events".* FROM "events" WHERE "events"."id" = $1 LIMIT 1 [["id", 0]]
2013-11-09 11:23:34 +01:00
Rafael Mendonça França
5741a8aae5
Mark broken test as pending
...
This will avoid the broken window effect in our test suite
2013-11-08 14:19:09 -02:00
Rafael Mendonça França
78bac468e6
Remove more skip
2013-11-08 14:18:54 -02:00