Browse files

merge conflict

  • Loading branch information...
2 parents 1a997dd + 5ad3e84 commit 4682605ae538170a26e422ee899cad4e65336fc1 @paulca committed Aug 19, 2011
Showing with 15 additions and 9 deletions.
  1. +1 −1 Gemfile
  2. +7 −3 Gemfile.lock
  3. +4 −1 app/models/configurable.rb
  4. +3 −4 dummy/Gemfile.lock
View
2 Gemfile
@@ -1,8 +1,8 @@
source 'http://rubygems.org'
group :development do
- gem 'rake'
gem 'jeweler'
+ gem 'rake'
gem 'rspec'
gem 'cucumber'
end
View
10 Gemfile.lock
@@ -9,14 +9,16 @@ GEM
json (~> 1.4.6)
term-ansicolor (~> 1.0.5)
diff-lcs (1.1.2)
+ gemcutter (0.6.1)
gherkin (2.3.3)
json (~> 1.4.6)
git (1.2.5)
- jeweler (1.5.2)
- bundler (~> 1.0.0)
+ jeweler (1.4.0)
+ gemcutter (>= 0.1.0)
git (>= 1.2.5)
- rake
+ rubyforge (>= 2.0.0)
json (1.4.6)
+ json_pure (1.5.3)
rake (0.8.7)
rspec (2.4.0)
rspec-core (~> 2.4.0)
@@ -26,6 +28,8 @@ GEM
rspec-expectations (2.4.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.4.0)
+ rubyforge (2.0.4)
+ json_pure (>= 1.1.7)
term-ansicolor (1.0.5)
PLATFORMS
View
5 app/models/configurable.rb
@@ -1,4 +1,5 @@
class Configurable < ActiveRecord::Base
+
validates_presence_of :name
validates_uniqueness_of :name
@@ -24,6 +25,8 @@ def self.[]=(key, value)
end
def self.[](key)
+ return self.defaults[key][:default] unless table_exists?
+
value = find_by_name(key).try(:value) || self.defaults[key][:default]
case self.defaults[key][:type]
when 'boolean'
@@ -53,4 +56,4 @@ def self.method_missing(name, *args)
end
end
-end
+end
View
7 dummy/Gemfile.lock
@@ -1,10 +1,9 @@
PATH
remote: ../
specs:
- configurable_engine (0.2.5)
- activerecord (~> 3.0)
- builder (~> 2.1.2)
- rails (~> 3.0)
+ configurable_engine (0.2.8)
+ activerecord (~> 3)
+ rails (~> 3)
GEM
remote: http://rubygems.org/

0 comments on commit 4682605

Please sign in to comment.