cached_column 0.2 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
12
12
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13
13
  gem.name = "cached_column"
14
14
  gem.require_paths = ["lib"]
15
- gem.version = "0.2"
15
+ gem.version = "0.3"
16
16
 
17
17
  gem.add_dependency "activerecord", "~> 3.0"
18
18
  gem.add_development_dependency "rspec"
data/lib/cached_column.rb CHANGED
@@ -11,6 +11,7 @@ class CachedColumn
11
11
 
12
12
  def before_save(record)
13
13
  record.send("#{column}=", computed_value(record))
14
+ true
14
15
  end
15
16
 
16
17
  def computed_value(record)
@@ -47,5 +47,12 @@ describe CachedColumn do
47
47
  instance.save
48
48
  instance.cached_column(44).should == 44
49
49
  end
50
+
51
+ it "caches false" do
52
+ model.cached_column(:boolean) { false }
53
+ instance = model.new
54
+ instance.save!
55
+ instance[:boolean].should == false
56
+ end
50
57
  end
51
58
  end
data/spec/schema.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  ActiveRecord::Schema.define(:version => 20120611163936) do
2
2
  create_table "test", :force => true do |t|
3
3
  t.integer "cached_column"
4
+ t.boolean "boolean"
4
5
  end
5
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cached_column
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: '0.3'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-03 00:00:00.000000000 Z
12
+ date: 2012-11-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  version: '0'
96
96
  requirements: []
97
97
  rubyforge_project:
98
- rubygems_version: 1.8.23
98
+ rubygems_version: 1.8.24
99
99
  signing_key:
100
100
  specification_version: 3
101
101
  summary: cached_column