groupy 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -33,7 +33,7 @@ spec = Gem::Specification.new do |s|
33
33
 
34
34
  # Change these as appropriate
35
35
  s.name = "groupy"
36
- s.version = "0.2.2"
36
+ s.version = "0.2.3"
37
37
  s.summary = "Categorise Active Records in nested groups with magical scopes, ? methods, and constants."
38
38
  s.author = "Matthew Rudy Jacobs"
39
39
  s.email = "MatthewRudyJacobs@gmail.com"
@@ -108,7 +108,7 @@ module Groupy
108
108
  else
109
109
  value_group.name
110
110
  end
111
- klass.const_set("#{constant_name.upcase}", value_group.value)
111
+ klass.const_set("#{constant_name.to_s.upcase}", value_group.value)
112
112
  end
113
113
  end
114
114
 
@@ -12,7 +12,8 @@ class GroupyTest < ActiveSupport::TestCase
12
12
  end
13
13
  attr_reader :dish
14
14
  attr_reader :spiciness
15
-
15
+ attr_reader :smelliness
16
+
16
17
  include Groupy
17
18
  groupy :dish do
18
19
  group :healthy do
@@ -37,6 +38,12 @@ class GroupyTest < ActiveSupport::TestCase
37
38
  value :extreme
38
39
  end
39
40
 
41
+ # we can do constants without suffices too
42
+ groupy :smelliness, :constants => true do
43
+ value :very_smelly
44
+ value :hardly_smelly
45
+ end
46
+
40
47
  end
41
48
 
42
49
  test "groupies" do
@@ -71,6 +78,7 @@ class GroupyTest < ActiveSupport::TestCase
71
78
  test "constants" do
72
79
  assert_equal "small", Food::SMALL_SPICINESS
73
80
  assert_equal "extreme", Food::EXTREME_SPICINESS
81
+ assert_equal "very_smelly", Food::VERY_SMELLY
74
82
  end
75
83
 
76
84
  class Thing
@@ -4,8 +4,8 @@ require 'groupy'
4
4
  require 'active_record'
5
5
 
6
6
  ActiveRecord::Base.establish_connection(
7
- :adapter => "sqlite3",
8
- :database => ":memory:"
7
+ :adapter => (RUBY_PLATFORM=="java" ? "jdbcsqlite3" : "sqlite3"),
8
+ :database => ":memory:"
9
9
  )
10
10
 
11
11
  ActiveRecord::Schema.define(:version => 0) do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groupy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 2
10
- version: 0.2.2
9
+ - 3
10
+ version: 0.2.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matthew Rudy Jacobs
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-14 00:00:00 +08:00
18
+ date: 2011-02-16 00:00:00 +08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency