Skip to content

Commit

Permalink
reduce max size of fixture IDs to fix sqlite2 tests, because sqlite2 …
Browse files Browse the repository at this point in the history
…was getting negative and changing values for ID field. See http://www.sqlite.org/datatypes.html

Signed-off-by: Yehuda Katz <wycats@gmail.com>
  • Loading branch information
thewoolleyman authored and wycats committed Sep 29, 2009
1 parent f95a7f8 commit 1901747
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/fixtures.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ class FixtureClassNotFound < StandardError #:nodoc:
# Any fixture labeled "DEFAULTS" is safely ignored. # Any fixture labeled "DEFAULTS" is safely ignored.


class Fixtures < (RUBY_VERSION < '1.9' ? YAML::Omap : Hash) class Fixtures < (RUBY_VERSION < '1.9' ? YAML::Omap : Hash)
MAX_ID = 2 ** 31 - 1 MAX_ID = 2 ** 30 - 1
DEFAULT_FILTER_RE = /\.ya?ml$/ DEFAULT_FILTER_RE = /\.ya?ml$/


@@all_cached_fixtures = {} @@all_cached_fixtures = {}
Expand Down
4 changes: 2 additions & 2 deletions activerecord/test/cases/fixtures_test.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -519,8 +519,8 @@ def test_identifies_symbols
end end


def test_identifies_consistently def test_identifies_consistently
assert_equal 1281023246, Fixtures.identify(:ruby) assert_equal 207281424, Fixtures.identify(:ruby)
assert_equal 2140105598, Fixtures.identify(:sapphire_2) assert_equal 1066363776, Fixtures.identify(:sapphire_2)
end end


TIMESTAMP_COLUMNS = %w(created_at created_on updated_at updated_on) TIMESTAMP_COLUMNS = %w(created_at created_on updated_at updated_on)
Expand Down

0 comments on commit 1901747

Please sign in to comment.