Permalink
Browse files

Merge remote-tracking branch 'teambox/rails3.1'

  • Loading branch information...
Chris Ledet
Chris Ledet committed Jan 27, 2012
2 parents 82760a3 + bb8629a commit 283f0bc5f7c9c0aadb5cf723cb9d50b83b5377ec
Showing with 43 additions and 41 deletions.
  1. +34 −32 Gemfile.lock
  2. +1 −1 lib/vestal_versions/reset.rb
  3. +1 −1 lib/vestal_versions/version_num.rb
  4. +4 −4 lib/vestal_versions/versions.rb
  5. +3 −3 vestal_versions.gemspec
View
@@ -2,49 +2,51 @@ PATH
remote: .
specs:
vestal_versions (1.2.2)
- activerecord (>= 3.0.0)
- activesupport (>= 3.0.0)
+ activerecord (>= 3.1)
+ activesupport (>= 3.1)
GEM
remote: http://rubygems.org/
specs:
- activemodel (3.0.3)
- activesupport (= 3.0.3)
- builder (~> 2.1.2)
- i18n (~> 0.4)
- activerecord (3.0.3)
- activemodel (= 3.0.3)
- activesupport (= 3.0.3)
- arel (~> 2.0.2)
- tzinfo (~> 0.3.23)
- activesupport (3.0.3)
- arel (2.0.4)
- builder (2.1.2)
- diff-lcs (1.1.2)
- i18n (0.4.2)
- rcov (0.9.9)
- rspec (2.1.0)
- rspec-core (~> 2.1.0)
- rspec-expectations (~> 2.1.0)
- rspec-mocks (~> 2.1.0)
- rspec-core (2.1.0)
- rspec-expectations (2.1.0)
+ activemodel (3.1.0)
+ activesupport (= 3.1.0)
+ bcrypt-ruby (~> 3.0.0)
+ builder (~> 3.0.0)
+ i18n (~> 0.6)
+ activerecord (3.1.0)
+ activemodel (= 3.1.0)
+ activesupport (= 3.1.0)
+ arel (~> 2.2.1)
+ tzinfo (~> 0.3.29)
+ activesupport (3.1.0)
+ multi_json (~> 1.0)
+ arel (2.2.1)
+ bcrypt-ruby (3.0.0)
+ builder (3.0.0)
+ diff-lcs (1.1.3)
+ i18n (0.6.0)
+ multi_json (1.0.3)
+ rcov (0.9.10)
+ rspec (2.6.0)
+ rspec-core (~> 2.6.0)
+ rspec-expectations (~> 2.6.0)
+ rspec-mocks (~> 2.6.0)
+ rspec-core (2.6.4)
+ rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
- rspec-mocks (2.1.0)
- simplecov (0.3.7)
- simplecov-html (>= 0.3.7)
- simplecov-html (0.3.9)
- sqlite3-ruby (1.3.2)
- tzinfo (0.3.23)
+ rspec-mocks (2.6.0)
+ simplecov (0.4.2)
+ simplecov-html (~> 0.4.4)
+ simplecov-html (0.4.5)
+ sqlite3 (1.3.4)
+ tzinfo (0.3.29)
PLATFORMS
ruby
DEPENDENCIES
- activerecord (>= 3.0.0)
- activesupport (>= 3.0.0)
rcov
rspec
simplecov
- sqlite3-ruby
+ sqlite3
vestal_versions!
@@ -14,7 +14,7 @@ module InstanceMethods
# documentation for more details.
def reset_to!(value)
if saved = skip_version{ revert_to!(value) }
- versions.send(:delete_records, versions.after(value))
+ versions.send(:delete, versions.after(value))
reset_version
end
saved
@@ -1,3 +1,3 @@
module VestalVersions
- VERSION = '1.2.2'
+ VERSION = '1.3.0'
end
@@ -15,22 +15,22 @@ def between(from, to)
condition = (from_number == to_number) ? to_number : Range.new(*[from_number, to_number].sort)
all(
:conditions => {:number => condition},
- :order => "#{aliased_table_name}.#{connection.quote_column_name('number')} #{(from_number > to_number) ? 'DESC' : 'ASC'}"
+ :order => "#{table_name}.#{connection.quote_column_name('number')} #{(from_number > to_number) ? 'DESC' : 'ASC'}"
)
end
# Returns all version records created before the version associated with the given value.
def before(value)
return [] if (number = number_at(value)).nil?
- all(:conditions => "#{aliased_table_name}.#{connection.quote_column_name('number')} < #{number}")
+ all(:conditions => "#{table_name}.#{connection.quote_column_name('number')} < #{number}")
end
# Returns all version records created after the version associated with the given value.
#
# This is useful for dissociating records during use of the +reset_to!+ method.
def after(value)
return [] if (number = number_at(value)).nil?
- all(:conditions => "#{aliased_table_name}.#{connection.quote_column_name('number')} > #{number}")
+ all(:conditions => "#{table_name}.#{connection.quote_column_name('number')} > #{number}")
end
# Returns a single version associated with the given value. The following formats are valid:
@@ -49,7 +49,7 @@ def after(value)
# untouched.
def at(value)
case value
- when Date, Time then last(:conditions => ["#{aliased_table_name}.created_at <= ?", value.to_time])
+ when Date, Time then last(:conditions => ["#{table_name}.created_at <= ?", value.to_time])
when Numeric then find_by_number(value.floor)
when String then find_by_tag(value)
when Symbol then respond_to?(value) ? send(value) : nil
View
@@ -16,9 +16,9 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files spec`.split("\n")
s.require_paths = ['lib']
- s.add_dependency 'activerecord', '>= 3.0.0'
- s.add_dependency 'activesupport', '>= 3.0.0'
+ s.add_dependency 'activerecord', '>= 3.1'
+ s.add_dependency 'activesupport', '>= 3.1'
s.add_development_dependency 'rspec'
- s.add_development_dependency 'sqlite3-ruby'
+ s.add_development_dependency 'sqlite3'
end

0 comments on commit 283f0bc

Please sign in to comment.