acts_as 0.5.1 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89ee132f5f8cffab67d1198b7945c2928fa959b6
4
- data.tar.gz: e0ef62b4129e0cb33d704b38ae67b513d185c02f
3
+ metadata.gz: f0ca79ea90ac972b908f31de9ab774534b4f166a
4
+ data.tar.gz: d20eb86344537b8fee43613f392ced6a7e56de76
5
5
  SHA512:
6
- metadata.gz: 3dc2de54feadd3e34651bce9a7bbe1c32bbb66fa67d5546f2fb8cfd6deac2a7d45ba2733c55418ce3eff0be4a61248731cfab2a5168708b560f8e38412d400a4
7
- data.tar.gz: e8b230d0042246afc72bda29b4a8771d685533607e70e94e92a0b089b131fa4486c229f5de21fef904ec86923d8804459a05778c9f28283878702b142d8528ab
6
+ metadata.gz: 6b50c510632665401c65a91f01c6eb9658a50338c3a275690cfeefd15fa1e41ee8719f932ef687efec85d8d0dd7e8a8ff75caec0f2eb79e041cbe6555c73477c
7
+ data.tar.gz: 26f6f41032c3561a7dd5ac88c8ad5ab18a680d490e86d116df90202364f9288fe0335d61a3aa5ae993bde2cae126b665efa307f481a7b189129059503c0f2457
data/Gemfile CHANGED
@@ -1,14 +1,4 @@
1
1
  source 'https://rubygems.org'
2
- ruby '2.0.0'
3
2
 
4
3
  # Specify your gem's dependencies in acts_as.gemspec
5
4
  gemspec
6
-
7
- gem 'activerecord', '~> 3.2'
8
-
9
- group :test do
10
- gem 'pry'
11
- gem 'rspec'
12
- gem 'sqlite3'
13
- gem 'strong_parameters'
14
- end
data/acts_as.gemspec CHANGED
@@ -6,8 +6,8 @@ require 'acts_as/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "acts_as"
8
8
  spec.version = ActsAs::VERSION
9
- spec.authors = ["winfred"]
10
- spec.email = ["winfred@developerauction.com"]
9
+ spec.authors = ["Hired, Inc", "Winfred Nadeau"]
10
+ spec.email = ["winfred@hired.com", "opensource@hired.com"]
11
11
  spec.description = %q{ActiveRecord extension for easy STI Delegation}
12
12
  spec.summary = %q{ delegate an entire 1:1 association worth of active record field-related helpers }
13
13
  spec.homepage = "http://github.com/wnadeau/acts_as"
@@ -20,4 +20,8 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.3"
22
22
  spec.add_development_dependency "rake"
23
+ spec.add_development_dependency 'rspec', '< 3.0'
24
+ spec.add_development_dependency 'sqlite3'
25
+
26
+ spec.add_dependency 'activerecord', '4.0.9'
23
27
  end
data/lib/acts_as.rb CHANGED
@@ -55,7 +55,7 @@ module ActsAs
55
55
  end.keys.first
56
56
  end
57
57
 
58
- def where(opts, *rest)
58
+ def where(opts = :chain, *rest)
59
59
  return self if opts.blank?
60
60
  relation = super
61
61
  #TODO support nested attribute joins like Guns.where(rebels: {strength: 10}))
@@ -103,11 +103,6 @@ module ActsAs
103
103
 
104
104
  build_prefix_methods(one_association, prefix)
105
105
 
106
- unless defined?(ActiveModel::ForbiddenAttributesProtection) && included_modules.include?(ActiveModel::ForbiddenAttributesProtection)
107
- attr_accessible *association_fields
108
- attr_accessible *prefix.map { |field| "#{one_association}_#{field}" }
109
- end
110
-
111
106
  delegate(*(association_fields + association_fields.map { |field| "#{field}=" }), to: one_association)
112
107
 
113
108
  acts_as_fields[one_association] = association_fields + prefix
@@ -1,3 +1,3 @@
1
1
  module ActsAs
2
- VERSION = "0.5.1"
2
+ VERSION = "0.6.1"
3
3
  end
data/spec/acts_as_spec.rb CHANGED
@@ -120,20 +120,6 @@ describe ActsAs do
120
120
  specify { rebel.should_not be_cool }
121
121
  end
122
122
 
123
- describe 'making things attr_accessible' do
124
- context 'when strong_parameters is not being used' do
125
- it 'automatically makes attrs accessible' do
126
- Rebel.accessible_attributes.should include('clan_name')
127
- end
128
- end
129
-
130
- context 'when strong_parameters is being used' do
131
- it 'does not use the attr_accessible api' do
132
- RebelWithStrongParams.accessible_attributes.should be_empty
133
- end
134
- end
135
- end
136
-
137
123
  describe '#previous_changes' do
138
124
  it 'should account for acted models' do
139
125
  rebel.strength = 12
data/spec/spec_helper.rb CHANGED
@@ -1,10 +1,8 @@
1
1
  require 'rubygems'
2
2
  require 'bundler/setup'
3
- require 'pry'
4
- require 'strong_parameters'
5
3
 
6
4
  require 'acts_as'
7
5
 
8
6
  RSpec.configure do |config|
9
7
  # some (optional) config here
10
- end
8
+ end
metadata CHANGED
@@ -1,52 +1,96 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
- - winfred
7
+ - Hired, Inc
8
+ - Winfred Nadeau
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-01-30 00:00:00.000000000 Z
12
+ date: 2014-10-09 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
15
16
  requirement: !ruby/object:Gem::Requirement
16
17
  requirements:
17
- - - ~>
18
+ - - "~>"
18
19
  - !ruby/object:Gem::Version
19
20
  version: '1.3'
20
21
  type: :development
21
22
  prerelease: false
22
23
  version_requirements: !ruby/object:Gem::Requirement
23
24
  requirements:
24
- - - ~>
25
+ - - "~>"
25
26
  - !ruby/object:Gem::Version
26
27
  version: '1.3'
27
28
  - !ruby/object:Gem::Dependency
28
29
  name: rake
29
30
  requirement: !ruby/object:Gem::Requirement
30
31
  requirements:
31
- - - '>='
32
+ - - ">="
32
33
  - !ruby/object:Gem::Version
33
34
  version: '0'
34
35
  type: :development
35
36
  prerelease: false
36
37
  version_requirements: !ruby/object:Gem::Requirement
37
38
  requirements:
38
- - - '>='
39
+ - - ">="
39
40
  - !ruby/object:Gem::Version
40
41
  version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rspec
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "<"
47
+ - !ruby/object:Gem::Version
48
+ version: '3.0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "<"
54
+ - !ruby/object:Gem::Version
55
+ version: '3.0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: sqlite3
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: activerecord
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - '='
75
+ - !ruby/object:Gem::Version
76
+ version: 4.0.9
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - '='
82
+ - !ruby/object:Gem::Version
83
+ version: 4.0.9
41
84
  description: ActiveRecord extension for easy STI Delegation
42
85
  email:
43
- - winfred@developerauction.com
86
+ - winfred@hired.com
87
+ - opensource@hired.com
44
88
  executables: []
45
89
  extensions: []
46
90
  extra_rdoc_files: []
47
91
  files:
48
- - .gitignore
49
- - .rspec
92
+ - ".gitignore"
93
+ - ".rspec"
50
94
  - Gemfile
51
95
  - LICENSE.txt
52
96
  - README.md
@@ -67,17 +111,17 @@ require_paths:
67
111
  - lib
68
112
  required_ruby_version: !ruby/object:Gem::Requirement
69
113
  requirements:
70
- - - '>='
114
+ - - ">="
71
115
  - !ruby/object:Gem::Version
72
116
  version: '0'
73
117
  required_rubygems_version: !ruby/object:Gem::Requirement
74
118
  requirements:
75
- - - '>='
119
+ - - ">="
76
120
  - !ruby/object:Gem::Version
77
121
  version: '0'
78
122
  requirements: []
79
123
  rubyforge_project:
80
- rubygems_version: 2.1.11
124
+ rubygems_version: 2.2.2
81
125
  signing_key:
82
126
  specification_version: 4
83
127
  summary: delegate an entire 1:1 association worth of active record field-related helpers