mournful_settings 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -44,8 +44,6 @@ be encrypted:
44
44
  true
45
45
  end
46
46
 
47
- If you use this option, you do not need an encrypted field in the database
48
-
49
47
  === Retrieving a setting
50
48
 
51
49
  To use a stored setting, use the 'for' class method:
@@ -20,7 +20,7 @@ module MournfulSettings
20
20
  end
21
21
 
22
22
  def for(name, default = nil)
23
- setting = find_by_name(name)
23
+ setting = find_by_name(name.to_s) # values should be passed to AR as strings
24
24
  setting ? setting.value : default
25
25
  end
26
26
 
@@ -1,9 +1,17 @@
1
1
  module MournfulSettings
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
4
4
 
5
5
  # History
6
6
  # =======
7
+ #
8
+ # 0.1.1: Improves query to find setting via for
9
+ # ---------------------------------------------
10
+ # It makes sense for settings to be identified via a symbol, as this is a label.
11
+ # However, best practice for querying a database is to pass in a string to
12
+ # represent the data being retrieved. So the _for_ method has been altered to
13
+ # convert the setting's name into a string before passing it to ActiveRecord
14
+ # within a query. See: https://github.com/ernie/squeel/issues/67
7
15
  #
8
16
  # 0.1.0: Acts As Mournful Setting
9
17
  # -------------------------------
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mournful_settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
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: 2013-03-12 00:00:00.000000000 Z
12
+ date: 2013-09-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -71,7 +71,8 @@ files:
71
71
  - test/dummy/test/setting_test.rb
72
72
  - test/test_helper.rb
73
73
  homepage: https://github.com/reggieb/mournful_settings
74
- licenses: []
74
+ licenses:
75
+ - MIT-LICENSE
75
76
  post_install_message:
76
77
  rdoc_options: []
77
78
  require_paths:
@@ -90,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
91
  version: '0'
91
92
  requirements: []
92
93
  rubyforge_project:
93
- rubygems_version: 1.8.24
94
+ rubygems_version: 1.8.25
94
95
  signing_key:
95
96
  specification_version: 3
96
97
  summary: Tool for adding encrypted settings to an app.