mince_data_model 1.1.0 → 1.1.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.
@@ -2,6 +2,6 @@ require 'rails/application'
2
2
 
3
3
  module DataStoreConfig
4
4
  def self.data_store
5
- Rails.application.config.data_store.to_s.camelize.constantize
5
+ @data_store ||= Rails.application.config.data_store.to_s.camelize.constantize
6
6
  end
7
- end
7
+ end
@@ -103,7 +103,7 @@ module MinceDataModel
103
103
 
104
104
  def translate_from_data_store(hash)
105
105
  if hash
106
- hash["id"] = hash[data_store.primary_key_identifier] if hash[data_store.primary_key_identifier]
106
+ hash["id"] = hash[primary_key_identifier] if hash[primary_key_identifier]
107
107
  HashWithIndifferentAccess.new hash
108
108
  end
109
109
  end
@@ -114,6 +114,10 @@ module MinceDataModel
114
114
 
115
115
  private
116
116
 
117
+ def primary_key_identifier
118
+ @primary_key_identifier ||= data_store.primary_key_identifier
119
+ end
120
+
117
121
  def set_data_collection(collection_name)
118
122
  @data_collection = collection_name
119
123
  end
@@ -1,3 +1,3 @@
1
1
  module MinceDataModel
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mince_data_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-08-08 00:00:00.000000000 Z
14
+ date: 2012-08-31 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rspec