Josh Susser
1092c181b5
add dynamic finder bang version to raise RecordNotFound
...
[#905 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-08-25 23:33:16 -07:00
Josh Susser
143f5fbb21
refactor dynamic finder name matching into its own class
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-08-25 23:32:20 -07:00
Tarmo Tänav
77b003fb61
Use DECIMAL instead of INTEGER when casting as mysql doesn't work with just "INTEGER" and other databases don't like "UNSIGNED" which mysql requires
...
And don't mask exceptions.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-08-25 23:23:34 -07:00
Tarmo Tänav
3d2ac918b9
Cache migrated versions list in Migrator and use it to fetch the latest migrated version name [ #845 state:resolved]
...
Also optimized Migrator#current_version class method to fetch
only the latest version number and not all of them.
With this change no matter how many migrations there are the
schema_migrations table is only SELECTed from once.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-08-25 22:03:47 -07:00
Tarmo Tänav
a445cdd884
Load the first and not the last has_one result when doing join-based eager loading
...
This matters when the has_one is defined with an order in which case
there is an expectation that the first one will be loaded.
[#904 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-08-25 21:23:35 -07:00
Frederick Cheung
2dbda11945
Implement old-skool eagerloading for has_one :through
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-08-25 21:23:15 -07:00
Jeremy Kemper
172606e21f
Harmonize framework require strategy. Don't add self to load path since Rails initializer and RubyGems handle it.
2008-08-25 21:22:34 -07:00
Frederick Cheung
b7a37b742c
Fix preloading of has_one through associations
...
[#903 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-08-25 20:49:55 -07:00
Michael Koziarski
33ed19f428
Merge branch 'patches'
2008-08-24 14:34:47 +02:00
Xavier Noria
e02f0dcc24
Rollback the transaction when a before_* callback returns false.
...
Previously this would have committed the transaction but not carried out save or destroy operation.
[#891 state:committed]
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2008-08-24 14:34:24 +02:00
Jeremy Kemper
c471f13db6
Ruby 1.9 compat: Hash is now flattenable, so explicitly exclude it
2008-08-23 21:26:14 -07:00
Tarmo Tänav
74c3c701f7
Don't set "NULL" as a constraint on nullable columns [ #398 state:resolved]
...
This is already the default and adding it breaks SQL standards compatibility.
2008-08-23 19:51:09 +03:00
Tarmo Tänav
cf28109158
Always require activesupport, even if its constant already exists
...
This is needed because the existance of the ActiveSupport
constant by itself does not guarantee that the whole library
has been loaded.
Also load the StringInquirer in the Rails#env method as
the it might be called inside the initializer block
before activesupport itself has been loaded.
2008-08-23 18:05:52 +03:00
Josh Susser
e48e77e022
coerce blank strings to nil values for boolean and integer fields
...
[#860 state:resolved]
2008-08-22 16:26:40 -07:00
Tarmo Tänav
707ee0e269
Made migrations transactional for PostgreSQL [ #834 state:resolved]
...
Patch originally from http://dev.rubyonrails.org/ticket/5470
2008-08-22 14:46:25 -07:00
Jeremy Kemper
9dac5547ad
Merge branch 'master' into i18n
2008-08-22 13:01:53 -07:00
Jeremy Kemper
a6e05b18d6
Merge commit 'sven/i18n' into i18n
2008-08-22 12:44:14 -07:00
Patrick Reagan
683ff235e6
Ensure t.timestamps respects options. [ #828 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-08-22 12:48:00 +01:00
Tarmo Tänav
d3b894563a
Properly quote CREATE DATABASE parameters in postgresql [ #771 state:resolved]
2008-08-22 10:37:09 +03:00
Jeremy Kemper
6e3d2a7996
Revert "Performance: freeze cached rows instead of duping"
...
This reverts commit cd8e653d5b .
2008-08-21 21:40:49 -07:00
Jeremy Kemper
a5eb297424
Revert "coerce blank strings to nil values for boolean and integer fields"
...
This reverts commit aee14630d4 .
[#860 state:incomplete]
2008-08-21 21:34:37 -07:00
Josh Susser
aee14630d4
coerce blank strings to nil values for boolean and integer fields
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2008-08-21 19:33:25 +02:00
Sven Fuchs
aad429a46e
Merge branch 'master' into i18n
2008-08-21 19:04:39 +02:00
Iain Hecker
cf6840773b
Custom error messages scope improved
2008-08-21 18:40:44 +02:00
Peter Wagenet
8622787f87
Don't interpret decimals as table names in ActiveRecord::Associations::ClassMethods#references_eager_loaded_tables? [ #532 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-08-21 17:21:17 +01:00
Tom Lea
3724dafe71
Fix incorrect signature for NamedScope#respond_to? [ #852 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-08-21 16:39:27 +01:00
Miles Georgi
0d74e72e6d
Fix postgres bug when change_column is called with invalid parameters. [ #861 state:resolved]
...
Signed-off-by: Tarmo Tänav <tarmo@itech.ee >
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-08-21 16:22:14 +01:00
Philip Hallstrom
49c0e1e594
Fix generated WHERE IN query for named scopes. [ #583 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-08-21 16:11:28 +01:00
Xavier Noria
a970f916fb
Fix has_many#count_records. [ #865 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-08-21 15:48:04 +01:00
Jakub Kuźma
ea40f71431
Fix that has_one natural assignment to already associated record. [ #854 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-08-21 15:21:21 +01:00
Ryan Bates
2415652660
Support find_all on named scopes. [ #730 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-08-21 12:37:19 +01:00
Iain Hecker
72366398b2
Removed en-US ruby locale in favor of yaml
2008-08-20 18:01:13 +02:00
Iain Hecker
febe2ea977
Locale file changed to yaml
2008-08-20 18:01:12 +02:00
Iain Hecker
e2b191681e
Added :value as interpolation variable available to error messages
2008-08-20 17:41:43 +02:00
Iain Hecker
c531248938
Introduced AR::Base.human_name to validations
2008-08-20 17:39:43 +02:00
Iain Hecker
ae8a35d8f6
Added Base.human_name method
2008-08-20 17:39:43 +02:00
Jeremy Kemper
cd8e653d5b
Performance: freeze cached rows instead of duping
2008-08-18 17:34:38 -07:00
Nathan Witmer
8cfdcdb35d
Updated has_and_belongs_to_many association to fix :finder_sql interpolation. [ #848 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-08-16 22:23:48 +01:00
Tarmo Tänav
2b69a636c4
Fixed STI type condition for eager loading of associations
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-08-16 20:41:19 +01:00
Ryan Bates
8f4d3957a6
Don't raise exception when comparing ActiveRecord::Reflection. [ #842 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-08-16 20:21:36 +01:00
Tarmo Tänav
b3c9d53b34
Use type_condition method for hmt STI condition
2008-08-15 15:57:33 -07:00
Tarmo Tänav
e3523f1d33
Fixed validates_uniqueness_of with decimal columns
...
Only use special case-sensitive comparison operators for text columns in
validates_uniqueness_of as mysql can fail at decimal comparisons with
the BINARY operator.
2008-08-15 15:44:11 -07:00
Iain Hecker
ffeab4e0c1
Cleaned up ActiveRecord i18n scoping
2008-08-14 10:48:33 +02:00
Eloy Duran
1ee9e3fa5c
Fix ActiveRecord::NamedScope::Scope#respond_to? [ #818 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-08-13 13:04:42 +01:00
Sven Fuchs
e3ecc3375f
provide more useful feedback on missing translations for validation error messages
2008-08-13 13:52:07 +02:00
Sven Fuchs
f26380b775
switch to using I18n.load_translations instead of requiring plain ruby files
2008-08-13 09:53:25 +02:00
Tarmo Tänav
a5aad2e81f
Fixed Time/Date object serialization
...
Time/Date objects used to be converted to_s instead of to_uaml
which made them unserializable.
2008-08-12 20:29:07 -07:00
Tom Lea
992fda16ed
Serialized attributes will now always be saved even with partial_updates turned on.
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#788 state:committed]
2008-08-12 18:15:50 +02:00
Trevor Turk
81c12d1f63
move logging of protected attribute removal into log_protected_attribute_removal method
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#804 status:committed]
2008-08-12 09:52:06 +02:00
Michalis Polakis
c7375d74d9
Alias subquery used in calculations, to provide better compatibility with databases such as MonetDB
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
Signed-off-by: Tom Ward <tom@popdog.net >
[#796 state:committed]
2008-08-11 16:48:45 +02:00