vestal_versions 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -18,6 +18,7 @@ begin
18
18
  Jeweler::RubyforgeTasks.new do |r|
19
19
  r.doc_task = 'rdoc'
20
20
  end
21
+ Jeweler::GemcutterTasks.new
21
22
  rescue LoadError
22
23
  puts 'Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com'
23
24
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.0
1
+ 0.8.1
@@ -8,12 +8,10 @@ module LaserLemon
8
8
 
9
9
  module ClassMethods
10
10
  def versioned(options = {})
11
- class_inheritable_accessor :versioned_columns
12
- self.versioned_columns = case
13
- when options[:only] then column_names & Array(options[:only]).map(&:to_s)
14
- when options[:except] then column_names - Array(options[:except]).map(&:to_s)
15
- else column_names
16
- end
11
+ class_inheritable_accessor :version_only_columns
12
+ self.version_only_columns = Array(options[:only]).map(&:to_s).uniq if options[:only]
13
+ class_inheritable_accessor :version_except_columns
14
+ self.version_except_columns = Array(options[:except]).map(&:to_s).uniq if options[:except]
17
15
 
18
16
  has_many :versions, :as => :versioned, :order => 'versions.number ASC', :dependent => :delete_all do
19
17
  def between(from, to)
@@ -55,6 +53,14 @@ module LaserLemon
55
53
 
56
54
  module InstanceMethods
57
55
  private
56
+ def versioned_columns
57
+ @versioned_columns ||= case
58
+ when version_only_columns then self.class.column_names & version_only_columns
59
+ when version_except_columns then self.class.column_names - version_except_columns
60
+ else self.class.column_names
61
+ end
62
+ end
63
+
58
64
  def needs_initial_version?
59
65
  versions.empty?
60
66
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{vestal_versions}
8
- s.version = "0.8.0"
8
+ s.version = "0.8.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["laserlemon"]
12
- s.date = %q{2009-09-24}
12
+ s.date = %q{2009-10-01}
13
13
  s.description = %q{Keep a DRY history of your ActiveRecord models' changes}
14
14
  s.email = %q{steve@laserlemon.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vestal_versions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - laserlemon
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-24 00:00:00 -04:00
12
+ date: 2009-10-01 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency