acts_as_price 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,17 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rails', '3.0.7'
4
+
5
+ #only use in test envirnoment
6
+ group :test do
7
+ gem 'rspec-rails'
8
+ gem 'shoulda-matchers'
9
+ gem 'autotest'
10
+ gem 'autotest-growl'
11
+ gem 'rcov'
12
+ gem 'metrical'
13
+ gem 'activerecord-nulldb-adapter'
14
+ end
15
+ group :development do
16
+ gem "jeweler", "~> 1.5.2"
17
+ end
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 [name of plugin creator]
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,60 @@
1
+ =INSTALLATION
2
+ rails plugin install git@github.com:jeroeningen/acts_as_price.git
3
+
4
+ =USAGE
5
+ Create a column in the table of your database which you want to acts as a price.
6
+
7
+ NOTE THAT THE COLUMN MUST BE OF THE TYPE INTEGER.
8
+
9
+ In your model add the following:
10
+ - acts_as_price column_name, :validates = true
11
+
12
+ column_name is the name of your database column e.g. price or price_per_liter.
13
+
14
+ validates is optional and add validation to the column
15
+
16
+ This plugin creates the following getters and setters:
17
+ - 'price_in_cents' and '<column_name>_in_cents' #sets and returns the price in cents
18
+ - 'price' and '<column_name>' #sets and returns the price
19
+
20
+ =EXAMPLES
21
+ car = Car.new :price => 12999
22
+
23
+ car.price #12999.00
24
+
25
+ car.price_in_cents #1299900
26
+
27
+ fuel = Fueltype.new :price_per_liter => 1.12
28
+
29
+ fuel.price #1.12
30
+
31
+ fuel.price_in_cents #112
32
+
33
+ fuel.price_per_liter #1.12
34
+
35
+ fuel.price_per_liter_in_cents #1.12
36
+
37
+ =RSPEC INTERGRATION
38
+ Acts As Price comes with a helper method to automatically test the plugin using Rspec.
39
+
40
+ To use this method please add the following to your spec_helper.rb file:
41
+ - config.include(ActsAsPriceHelper)
42
+ Now you may add the following code to your spec-files for your models:
43
+ context "given an valid model" do
44
+ it "should acts as price" do
45
+ test_acts_as_price_methods <column_name>, <fixture or stub>
46
+ end
47
+ end
48
+
49
+ =TESTING
50
+ To test the plugin use the command 'rake test' or 'rspec spec/*_spec.rb' inside the dir '~/vendor/plugins/acts_as_price'
51
+
52
+ =KNOWN BUGS
53
+ The acts_as_price plugin does not accept comma-seperated prices at the moment.
54
+
55
+ =NOTES
56
+ This plugin comes with Rspec tests.
57
+ However this plugin assumes that you have a database configuration, it actually don't use the database for the Rspec tests.
58
+
59
+ =FEEDBACK AND BUGS REPORTS
60
+ For feedback and bug reports contact: jeroeningen@gmail.com
data/Rakefile ADDED
@@ -0,0 +1,58 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ require 'rake'
4
+ require 'rake/testtask'
5
+ require 'rake/rdoctask'
6
+
7
+ desc 'Default: run unit tests.'
8
+ task :default => :test
9
+
10
+ desc 'Test the acts_as_price plugin.'
11
+ Rake::TestTask.new(:test) do |t|
12
+ t.libs << 'lib'
13
+ t.libs << 'spec'
14
+ t.pattern = 'spec/*_spec.rb'
15
+ t.verbose = true
16
+ end
17
+
18
+ desc 'Generate documentation for the acts_as_price plugin.'
19
+ Rake::RDocTask.new(:rdoc) do |rdoc|
20
+ rdoc.rdoc_dir = 'rdoc'
21
+ rdoc.title = 'ActsAsPrice'
22
+ rdoc.options << '--line-numbers' << '--inline-source'
23
+ rdoc.rdoc_files.include("README.rdoc")
24
+ rdoc.rdoc_files.include('lib/**/*.rb')
25
+ end
26
+
27
+ begin
28
+ Bundler.setup(:default, :development)
29
+ rescue Bundler::BundlerError => e
30
+ $stderr.puts e.message
31
+ $stderr.puts "Run `bundle install` to install missing gems"
32
+ exit e.status_code
33
+ end
34
+ require 'rake'
35
+
36
+ begin
37
+ require 'jeweler'
38
+ Jeweler::Tasks.new do |gem|
39
+ gem.name = "acts_as_price"
40
+ gem.homepage = "http://github.com/jeroeningen/acts_as_price"
41
+ gem.license = "MIT"
42
+ gem.summary = %Q{A specified database column acts as a price}
43
+ gem.description = %Q{A specified database column acts as a price and creates on the fly methods like 'price' and 'price_in_cents'. For more information visit: http://github.com/jeroeningen/acts_as_price}
44
+ gem.email = "jeroeningen@gmail.com"
45
+ gem.authors = ["Jeroen van Ingen"]
46
+ gem.add_runtime_dependency 'rails', '3.0.7'
47
+ gem.add_development_dependency 'rspec-rails'
48
+ gem.add_development_dependency 'shoulda-matchers'
49
+ gem.add_development_dependency 'autotest'
50
+ gem.add_development_dependency 'autotest-growl'
51
+ gem.add_development_dependency 'rcov'
52
+ gem.add_development_dependency 'metrical'
53
+ gem.add_development_dependency 'activerecord-nulldb-adapter'
54
+ end
55
+ rescue LoadError
56
+ puts "Jeweler not available. Install it with: sudo gem install jeweler -s http://gemcutter.org"
57
+ end
58
+ Jeweler::RubygemsDotOrgTasks.new
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
data/init.rb ADDED
@@ -0,0 +1 @@
1
+ require 'acts_as_price'
data/install.rb ADDED
File without changes
@@ -0,0 +1,46 @@
1
+ module ActiveRecord
2
+ module Acts
3
+ module Price
4
+
5
+ def self.included(base)
6
+ base.extend(ClassMethods)
7
+ end
8
+
9
+ module ClassMethods
10
+ # Specify the column_name that needs to act as price
11
+ #
12
+ # Valid options:
13
+ # * :validates => true (performs validates_presence_of and validates_numericality_of)
14
+ def acts_as_price column_name, options = {}
15
+ validates column_name, :presence => true, :numericality => {:greater_than => 0} if options[:validates] == true
16
+
17
+ #setters
18
+ define_method("#{column_name}=") do |val|
19
+ super((val.to_f * 100).to_s)
20
+ end
21
+ alias_method("price=", "#{column_name}=")
22
+
23
+ define_method("price_in_cents=") do |val|
24
+ self.send("price=", val.to_f / 100)
25
+ end
26
+ alias_method "#{column_name}_in_cents=", "price_in_cents="
27
+
28
+ #getters
29
+ define_method(column_name) do
30
+ if super == 0.0
31
+ ""
32
+ else
33
+ sprintf("%.2f", super.to_f / 100)
34
+ end
35
+ end
36
+ alias_method "price", column_name
37
+
38
+ define_method("price_in_cents") {((send column_name).to_f * 100).to_s.to_i}
39
+ alias_method "#{column_name}_in_cents", "price_in_cents"
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+
46
+ ActiveRecord::Base.send(:include, ActiveRecord::Acts::Price)
@@ -0,0 +1,76 @@
1
+ module ActsAsPriceHelper
2
+ # Test the acts_as_price plugin for the specified column_name and model
3
+ #
4
+ # Note the you can also specify the model in a before block in your tests
5
+ def test_acts_as_price_methods column_name, acts_as_price_model = nil
6
+ @acts_as_price_model = acts_as_price_model if acts_as_price_model
7
+
8
+ @column_name = column_name
9
+ columns_in_cents.each do |column|
10
+ @acts_as_price_model.send(column).should == @acts_as_price_model.price_in_cents
11
+ end
12
+ columns_in_doubles.each do |column|
13
+ @acts_as_price_model.send(column).should == @acts_as_price_model.price
14
+ end
15
+
16
+ #normal test for setter
17
+ test_setter_in_cents "144"
18
+ test_setter_in_doubles "1.41"
19
+
20
+ #test for special cases
21
+ #test if 1.5 is returned as 1.50
22
+ test_setter_in_doubles "1.5"
23
+
24
+ #test if float returns 2.05 correctly
25
+ #float can return 2.05 as 2.04 in some cases
26
+ test_setter_in_doubles "2.05"
27
+
28
+ #test an empty_setter
29
+ test_setter_in_cents ""
30
+ test_setter_in_doubles ""
31
+ end
32
+
33
+ def test_setter_in_cents cents
34
+ columns_in_cents.each do |setter|
35
+ @acts_as_price_model.send("#{setter}=", cents)
36
+ columns_in_cents.each do |getter|
37
+ @acts_as_price_model.send(getter).should == cents.to_i
38
+ end
39
+ columns_in_doubles.each do |getter|
40
+ if cents == ""
41
+ @acts_as_price_model.send(getter).should == ""
42
+ else
43
+ @acts_as_price_model.send(getter).should == sprintf("%.2f", (cents.to_f / 100).to_s)
44
+ end
45
+ end
46
+ end
47
+ end
48
+
49
+ def test_setter_in_doubles double
50
+ columns_in_doubles.each do |setter|
51
+ @acts_as_price_model.send("#{setter}=", double)
52
+ columns_in_cents.each do |getter|
53
+ @acts_as_price_model.send(getter).should == (double.to_f * 100).to_s.to_i
54
+ end
55
+ columns_in_doubles.each do |getter|
56
+ if double == ""
57
+ @acts_as_price_model.send(getter).should == ""
58
+ else
59
+ @acts_as_price_model.send(getter).should == sprintf("%.2f", double)
60
+ end
61
+ end
62
+ end
63
+ end
64
+
65
+ def columns_in_cents
66
+ [:price_in_cents, "#{@column_name}_in_cents"]
67
+ end
68
+
69
+ def columns_in_doubles
70
+ [:price, @column_name]
71
+ end
72
+
73
+ def columns
74
+ columns_in_doubles + columns_in_cents
75
+ end
76
+ end
data/spec/car_spec.rb ADDED
@@ -0,0 +1,65 @@
1
+ require "#{File.dirname(__FILE__)}/spec_helper"
2
+
3
+ describe Car do
4
+ before(:each) do
5
+ @column_name = :price
6
+ @acts_as_price_model = stub_model(Car, :brand => "Ford", :cartype => "Focus", :price => "23995.99")
7
+ end
8
+
9
+ context "given an empty car" do
10
+ it "should return an invalid car" do
11
+ car = Car.new
12
+ should validate_presence_of :brand
13
+ should validate_presence_of :cartype
14
+ car.valid?.should be_false
15
+ car.save.should be_false
16
+ end
17
+ end
18
+
19
+ context "given an valid car" do
20
+ it "should succesfully save" do
21
+ car = Car.new @acts_as_price_model.attributes
22
+ car.valid?.should be_true
23
+ car.save.should be_true
24
+ end
25
+ end
26
+
27
+ context "return the price" do
28
+ it "should return the price in cents" do
29
+ columns_in_cents.each do |column|
30
+ @acts_as_price_model.send(column).should == 2399599
31
+ end
32
+ end
33
+ it "should return the price" do
34
+ columns_in_doubles.each do |column|
35
+ @acts_as_price_model.send(column).should == "23995.99"
36
+ end
37
+ end
38
+ end
39
+
40
+ context "set the price for hundred different prices" do
41
+ 2200000.upto(2200100) do |i|
42
+ it "should set the price in cents and return it correctly" do
43
+ test_setter_in_cents i.to_s
44
+ end
45
+ it "should set the price and return it correctly" do
46
+ test_setter_in_doubles sprintf("%.2f", i.to_f / 100)
47
+ end
48
+ end
49
+
50
+ end
51
+
52
+ context "given a float as price" do
53
+ it "should convert it to the right price in cents" do
54
+ test_setter_in_doubles "25500.5"
55
+ test_setter_in_doubles "21599.05"
56
+ end
57
+ end
58
+
59
+ context "given the price is zero" do
60
+ it "should return an empty price per liter" do
61
+ test_setter_in_cents ""
62
+ test_setter_in_doubles ""
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,64 @@
1
+ require "#{File.dirname(__FILE__)}/spec_helper"
2
+
3
+ describe Fueltype do
4
+ before(:each) do
5
+ @column_name = :price_per_liter
6
+ @acts_as_price_model = stub_model(Fueltype, :name => "Euro 95", :price_per_liter => "1.55")
7
+ end
8
+
9
+ context "given an empty fueltype" do
10
+ it "should give an invalid fueltype and not save it" do
11
+ fueltype = Fueltype.new
12
+ should validate_presence_of :name
13
+ should validate_presence_of @column_name
14
+ fueltype.valid?.should be_false
15
+ fueltype.save.should be_false
16
+ end
17
+ end
18
+
19
+ context "given an valid fueltype" do
20
+ it "should be valid and saved" do
21
+ fueltype = Fueltype.new @acts_as_price_model.attributes
22
+ fueltype.valid?.should be_true
23
+ fueltype.save.should be_true
24
+ end
25
+ end
26
+
27
+ context "return the fueltype price" do
28
+ it "should return the price in cents" do
29
+ columns_in_cents.each do |column|
30
+ @acts_as_price_model.send(column).should == 155
31
+ end
32
+ end
33
+ it "should return the price" do
34
+ columns_in_doubles.each do |column|
35
+ @acts_as_price_model.send(column).should == "1.55"
36
+ end
37
+ end
38
+ end
39
+
40
+ context "set the price per liter for hundred different prices" do
41
+ 1.upto(100).each do |i|
42
+ it "should set the price per liter in cents and return it correctly" do
43
+ test_setter_in_cents i.to_s
44
+ end
45
+ it "should set the price per liter and return it correctly" do
46
+ test_setter_in_doubles sprintf("%.2f", i.to_f / 100)
47
+ end
48
+ end
49
+ end
50
+
51
+ context "given a float as price per liter" do
52
+ it "should convert it to the right price in cents" do
53
+ test_setter_in_doubles "1.5"
54
+ test_setter_in_doubles "2.05"
55
+ end
56
+ end
57
+
58
+ context "given the price is zero" do
59
+ it "should return an empty price per liter" do
60
+ test_setter_in_cents ""
61
+ test_setter_in_doubles ""
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,7 @@
1
+ #car model
2
+ class Car < ActiveRecord::Base
3
+ validates :brand, :presence => true
4
+ validates :cartype, :presence => true
5
+
6
+ acts_as_price :price
7
+ end
@@ -0,0 +1,6 @@
1
+ #fueltype model
2
+ class Fueltype < ActiveRecord::Base
3
+ validates :name, :presence => true
4
+
5
+ acts_as_price :price_per_liter, :validates => true
6
+ end
@@ -0,0 +1,31 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ ENV["RAILS_ENV"] ||= 'test'
3
+
4
+ require File.expand_path("../../../../../config/environment", __FILE__)
5
+
6
+ require 'rspec/rails'
7
+ require File.expand_path("../models/fueltype", __FILE__)
8
+ require File.expand_path("../models/car", __FILE__)
9
+
10
+ require 'nulldb_rspec'
11
+
12
+ include NullDB::RSpec::NullifiedDatabase
13
+
14
+ RSpec.configure do |config|
15
+ # == Mock Framework
16
+ #
17
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
18
+ #
19
+ # config.mock_with :mocha
20
+ # config.mock_with :flexmock
21
+ # config.mock_with :rr
22
+ config.mock_with :rspec
23
+
24
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
25
+ # examples within a transaction, remove the following line or assign false
26
+ # instead of true.
27
+ config.use_transactional_fixtures = true
28
+
29
+ #load helper methods
30
+ config.include(ActsAsPriceHelper)
31
+ end
data/uninstall.rb ADDED
File without changes
metadata ADDED
@@ -0,0 +1,230 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: acts_as_price
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 0
10
+ version: 0.1.0
11
+ platform: ruby
12
+ authors:
13
+ - Jeroen van Ingen
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-04-28 00:00:00 -07:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: rails
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - "="
27
+ - !ruby/object:Gem::Version
28
+ hash: 9
29
+ segments:
30
+ - 3
31
+ - 0
32
+ - 7
33
+ version: 3.0.7
34
+ prerelease: false
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: jeweler
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ hash: 7
45
+ segments:
46
+ - 1
47
+ - 5
48
+ - 2
49
+ version: 1.5.2
50
+ prerelease: false
51
+ type: :development
52
+ version_requirements: *id002
53
+ - !ruby/object:Gem::Dependency
54
+ name: rails
55
+ requirement: &id003 !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - "="
59
+ - !ruby/object:Gem::Version
60
+ hash: 9
61
+ segments:
62
+ - 3
63
+ - 0
64
+ - 7
65
+ version: 3.0.7
66
+ prerelease: false
67
+ type: :runtime
68
+ version_requirements: *id003
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec-rails
71
+ requirement: &id004 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ hash: 3
77
+ segments:
78
+ - 0
79
+ version: "0"
80
+ prerelease: false
81
+ type: :development
82
+ version_requirements: *id004
83
+ - !ruby/object:Gem::Dependency
84
+ name: shoulda-matchers
85
+ requirement: &id005 !ruby/object:Gem::Requirement
86
+ none: false
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ hash: 3
91
+ segments:
92
+ - 0
93
+ version: "0"
94
+ prerelease: false
95
+ type: :development
96
+ version_requirements: *id005
97
+ - !ruby/object:Gem::Dependency
98
+ name: autotest
99
+ requirement: &id006 !ruby/object:Gem::Requirement
100
+ none: false
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ hash: 3
105
+ segments:
106
+ - 0
107
+ version: "0"
108
+ prerelease: false
109
+ type: :development
110
+ version_requirements: *id006
111
+ - !ruby/object:Gem::Dependency
112
+ name: autotest-growl
113
+ requirement: &id007 !ruby/object:Gem::Requirement
114
+ none: false
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ hash: 3
119
+ segments:
120
+ - 0
121
+ version: "0"
122
+ prerelease: false
123
+ type: :development
124
+ version_requirements: *id007
125
+ - !ruby/object:Gem::Dependency
126
+ name: rcov
127
+ requirement: &id008 !ruby/object:Gem::Requirement
128
+ none: false
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ hash: 3
133
+ segments:
134
+ - 0
135
+ version: "0"
136
+ prerelease: false
137
+ type: :development
138
+ version_requirements: *id008
139
+ - !ruby/object:Gem::Dependency
140
+ name: metrical
141
+ requirement: &id009 !ruby/object:Gem::Requirement
142
+ none: false
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ hash: 3
147
+ segments:
148
+ - 0
149
+ version: "0"
150
+ prerelease: false
151
+ type: :development
152
+ version_requirements: *id009
153
+ - !ruby/object:Gem::Dependency
154
+ name: activerecord-nulldb-adapter
155
+ requirement: &id010 !ruby/object:Gem::Requirement
156
+ none: false
157
+ requirements:
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ hash: 3
161
+ segments:
162
+ - 0
163
+ version: "0"
164
+ prerelease: false
165
+ type: :development
166
+ version_requirements: *id010
167
+ description: "A specified database column acts as a price and creates on the fly methods like 'price' and 'price_in_cents'. For more information visit: http://github.com/jeroeningen/acts_as_price"
168
+ email: jeroeningen@gmail.com
169
+ executables: []
170
+
171
+ extensions: []
172
+
173
+ extra_rdoc_files:
174
+ - README.rdoc
175
+ files:
176
+ - Gemfile
177
+ - MIT-LICENSE
178
+ - README.rdoc
179
+ - Rakefile
180
+ - VERSION
181
+ - init.rb
182
+ - install.rb
183
+ - lib/acts_as_price.rb
184
+ - lib/acts_as_price_helper.rb
185
+ - spec/car_spec.rb
186
+ - spec/fueltype_spec.rb
187
+ - spec/models/car.rb
188
+ - spec/models/fueltype.rb
189
+ - spec/spec_helper.rb
190
+ - uninstall.rb
191
+ has_rdoc: true
192
+ homepage: http://github.com/jeroeningen/acts_as_price
193
+ licenses:
194
+ - MIT
195
+ post_install_message:
196
+ rdoc_options: []
197
+
198
+ require_paths:
199
+ - lib
200
+ required_ruby_version: !ruby/object:Gem::Requirement
201
+ none: false
202
+ requirements:
203
+ - - ">="
204
+ - !ruby/object:Gem::Version
205
+ hash: 3
206
+ segments:
207
+ - 0
208
+ version: "0"
209
+ required_rubygems_version: !ruby/object:Gem::Requirement
210
+ none: false
211
+ requirements:
212
+ - - ">="
213
+ - !ruby/object:Gem::Version
214
+ hash: 3
215
+ segments:
216
+ - 0
217
+ version: "0"
218
+ requirements: []
219
+
220
+ rubyforge_project:
221
+ rubygems_version: 1.3.7
222
+ signing_key:
223
+ specification_version: 3
224
+ summary: A specified database column acts as a price
225
+ test_files:
226
+ - spec/car_spec.rb
227
+ - spec/fueltype_spec.rb
228
+ - spec/models/car.rb
229
+ - spec/models/fueltype.rb
230
+ - spec/spec_helper.rb