Dirkjan Bussink
2a70c9691d
We shouldn't try to rescue every type of exception here
2014-03-31 13:35:28 +02:00
Dirkjan Bussink
c2894170bf
Dup string before changing encoding because it might be frozen
...
Calling String#force_encoding! on a frozen string throws an exception.
By dupping the string we prevent this from happening.
2014-03-27 13:47:08 +01:00
Charlie Somerville
05cb9e6854
depend on the right versions
2013-11-10 15:20:15 -05:00
Charlie Somerville
1a5734e0b5
use RAILS_VERSION file
2013-11-10 11:43:01 -05:00
Charlie Somerville
d537304b20
replace :: with _ to avoid wrong constant name exceptions
2013-10-29 20:16:52 -07:00
Charlie Somerville
ca90ecf2cb
use terrible hacks to make this work when rails tries to marshal
2013-10-29 20:06:11 -07:00
Charlie Somerville
4bb1d3ef20
cache a class with the extend module pre-included
2013-10-29 20:06:11 -07:00
Charlie Somerville
3770f13b97
replace uses of OrderedHash with just a regular hash
2013-10-15 15:20:43 -04:00
Charlie Somerville
9a2d6cad23
backport rails 4 assign attributes
2013-09-17 15:50:09 +10:00
Charlie Somerville
1d6053f5bf
remove -w from tests
2013-09-17 15:40:41 +10:00
Charlie Somerville
8573f7f86b
pull in gemspecs from upstream
2013-09-17 11:17:06 +10:00
Charlie Somerville
eefc42630f
restore 1.9.3 respond_to? behaviour when running on 1.9.3
2013-08-08 20:42:52 -07:00
Charlie Somerville
6ba9bd8d09
fix for new behaviour of respond_to?
2013-08-08 20:37:30 -07:00
Charlie Somerville
0b57366c77
use this hacky shit to emulate old behaviour of respond_to?
2013-08-08 20:37:30 -07:00
Charlie Somerville
e423b0095f
fix broken tests and warnings
2013-08-07 00:46:51 -07:00
Charlie Somerville
087bdaf5f8
don't run AR tests for non-sqlite3
2013-08-06 23:53:35 -07:00
Charlie Somerville
581ed6ab6e
fix AR tests
2013-08-06 19:40:44 -07:00
Charlie Somerville
117eeefb76
fix invalid YAML
2013-08-06 17:50:56 -07:00
Charlie Somerville
4299e71018
fix some AR tests on 1.9
2013-08-06 17:41:51 -07:00
Aman Gupta
5f847d2fa7
fix default to_a deprecation warnings
...
lib/active_record/associations/association_proxy.rb:215: warning: default `to_a' will be obsolete
2013-03-01 18:03:08 -08:00
Aman Gupta
e4652359c3
fix regression on ruby 1.8 /cc github/rails#4
2013-03-01 17:45:22 -08:00
Aman Gupta
9ab900156d
fix for ruby 2.0
...
this was manifesting as:
NoMethodError: undefined method `insert_record' for #<Array:0x007fb0ca5fa7f8>
gems/activerecord-2.3.14.github17/lib/active_record/associations/association_proxy.rb:149:in `send'
see http://tenderlovemaking.com/2012/09/07/protected-methods-and-ruby-2-0.html
2013-03-01 17:02:58 -08:00
Aman Gupta
c6bbe648e8
whitespace
2013-03-01 17:02:10 -08:00
Aaron Patterson
dc6f44fae6
just use return value of load_target
2013-03-01 17:02:10 -08:00
Aaron Patterson
76e373c559
just call methods on return value of load_target
2013-03-01 17:02:06 -08:00
Aaron Patterson
1d8013e2ce
@loaded is defined in initialize, so we should not need this
...
Conflicts:
activerecord/lib/active_record/associations/association_proxy.rb
2013-03-01 17:01:29 -08:00
sblackstone
cb312a2e76
Association Proxy should not undefine the default respond_to_missing
...
Conflicts:
activerecord/lib/active_record/associations/association_proxy.rb
2013-02-28 18:56:30 -08:00
Aman Gupta
e7be98f40c
Revert "fix multiple queries when chaining named scopes"
...
This reverts commit d43ecd5b32 .
2013-02-28 18:50:26 -08:00
Corey Donohoe
f6cf01337f
apply patch for cve-2013-0277
2013-02-11 10:47:45 -08:00
rick
46f1ddbff9
backport dynamic finder fix (CVE-2012-5664)
2013-01-02 15:02:25 -07:00
Joshua Peek
a27559cddf
Skip primary key check for HABTM inserts
2012-09-05 21:43:48 -05:00
Aman Gupta
d43ecd5b32
fix multiple queries when chaining named scopes
...
https://rails.lighthouseapp.com/projects/8994/tickets/5410-multiple-database-queries-when-chaining-named-scopes-with-rails-238-and-ruby-192
2012-08-15 17:35:23 -07:00
Aman Gupta
a2beda1177
force binary strings when logging sql statements
2012-08-14 12:52:51 -07:00
Justin Collins
a6eb61b7e4
Fix SQL injection via nested hashes in conditions
2012-06-12 23:14:10 -07:00
Aaron Patterson
6b46d65597
fixing sql injection problem
2011-08-16 14:57:48 -07:00
Aaron Patterson
fb1588c5ff
2.3.14. yay. :'(
2011-08-16 14:57:05 -07:00
Aaron Patterson
dea5a10f71
bumping to 2.3.13
2011-08-16 14:34:14 -07:00
Brian Cardarella
1aae5e70ef
Remove deprecation warning for ActiveRecord::Errors#generate_message. This is the same API that ActiveModel ended up using and that won't be changing.
2011-06-09 14:59:33 -07:00
Ryan Davis
79aa54d0c7
+ Switched to newer rdoc and gem package tasks (and their requires).
...
+ Fixed deprecated usage in gemspecs.
Bumped the version to 2.3.12 so I could test locally with actual
installs. If this is bad form for this project, please beat me up and
I'll split them out.
2011-05-25 01:49:15 -07:00
Casey Dreier
9f7ff621bd
Fixing dynamic finders on associations to properly send arguments to the find_by_* method. Closes issue #330 .
...
Commit fdfc8e3b9 introduced a bugfix to prevent additional values passed
to a dynamic find_or_create_by_x methods from confusing the finder.
This patch also broke the essential behavior of this method on an
association by incorrectly sending arguments to the find_by_x methods.
The finder method would always see its inputs as a single array of
values instead of individual arguments, almost guaranteeing that the
finder call would be incorrect, and that we'd always create a new
record instead.
This patch adds a splat operator to the parameter array we send along to
the dynamic finder so that it receives its inputs correctly, and
includes an additional test to ensure that repeated calls to
find_or_create_by_x only creates one new record.
2011-04-27 21:57:24 -04:00
Vijay Dev
6c42c142e2
fix incorrect version in deprecation message
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2011-02-20 13:32:18 -02:00
Michael Koziarski
b0c3d451a2
Prepare for the 2.3.11 release
2011-02-09 09:30:53 +13:00
Jeremy Kemper
bc302f2aec
Revert "use Object#class instead of Object#type"
...
This reverts commit 08d94d3f7e .
2011-01-10 14:14:25 -08:00
Tomasz Pajor
08d94d3f7e
use Object#class instead of Object#type
2011-01-09 15:12:25 -08:00
Michael Koziarski
84465a2cc1
Revert "In nested_attributes when association is not loaded and association record is saved then in memory record attributes should be saved"
...
This reverts commit 12bbc34aca .
It caused errors when combined with attr_accessible, piggy back attributes fetched by :select, etc. Leaving it in 3.0, but removing from 2.3
2010-12-08 09:48:54 +13:00
Will Bryant
0fee359278
Don't add non-new records back to the target array after loading targets on associations, as that makes destroy_all destroy any created records that don't match the scope destroy_all is called on
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2010-12-08 09:48:16 +13:00
Alexandru Catighera
1681ede605
Fix ActiveRecord calculations when grouped by multiple fields
2010-11-16 11:06:49 -08:00
toby cabot
bdfddb09d7
bug 1108: yield to block provided to find_or_create_by_x
...
Starting in 2.3.8 we stopped yielding to blocks passed in to
find_or_create_by_x methods. This patch restores that behavior and
adds a case to test it.
2010-10-20 17:23:54 -07:00
toby cabot
fdfc8e3b9c
bug 1108: fix a bug with find_or_create_by and additional values
...
There was a bug with find_or_create_by_x introduced in 2.3.9 - if you
included extra parameters for the create() then those parameters would
confuse the find() so you'd never get to the create(). This patch
filters the parameters so we only pass to find() the subset that it's
interested in. The code for the filtering was modelled on the code in
base.rb's method_missing().
2010-10-20 17:23:54 -07:00
Michael Koziarski
f5ed5c317e
Prepare for the 2.3.10 release
2010-10-15 08:41:59 +13:00