hobo 2.1.0.pre1 → 2.1.0.pre2

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: 5de6d624783c705dfe7dd66c79518ebc2ec68b3f
4
- data.tar.gz: 634bf9f6c3831df42e818c03fe46a45d0a8e5255
3
+ metadata.gz: d7336e8e2a7390f1f40021cfdd08a189bf29ac35
4
+ data.tar.gz: 9f288f5771fffa1229ef481c612818669798ad62
5
5
  SHA512:
6
- metadata.gz: 78ea8f82e5ac95ddcc3085afd7cce6ac1f1d01f499b8b589ab3f2ab1e55111d7671b9e5c735ed8754c7755463b160982a68eceb3847e01549cb407c36205fb07
7
- data.tar.gz: df53268326185eef5f0cea67c8fe7773a7dc0f9d5883e823aa0a911bf8cf78680e20221dadc1658a9ebcc7bdcd04e12697e09056ec98484b8870cc33d96d98f8
6
+ metadata.gz: 6dad7a8ab5cf38b41f9d058b9d964660fa2262ef60cea0d1b2163796e7d503c50dd0d3f4a5481bdcde93a713121adb2163a577b4176c742d285c4f597e4a42ad
7
+ data.tar.gz: 9ed8941bc73ad88f3f282a47e4cdcfcc2bd8a86417dbd0988af5b5a525eb3a41540a3c323aec87401e7f7ae2f97cb1670f013ca38dc873e754f0ac691cc33b25
@@ -47,6 +47,7 @@ In order to make Hobo compatible with Rails 4, these are the main changes that h
47
47
  ## Other
48
48
  * `protected_attributes` gem has been added to support the "old" way of protecting attributes
49
49
  * Domizio has made Hobo thread safe :)
50
+ * Hobo's custom `will_paginate` has been packaged into the `hobo_will_paginate` gem. This should make possible to install Hobo without Git (it seems to be a bit hard under Windows).
50
51
 
51
52
 
52
53
 
@@ -54,4 +55,4 @@ In order to make Hobo compatible with Rails 4, these are the main changes that h
54
55
 
55
56
  The integration tests in the "agility_bootstrap" folder have been updated for Hobo 2.1 and Rails 4.
56
57
 
57
- see https://github.com/tablatom/hobo/integration_tests/agility_bootstrap/README
58
+ see https://github.com/Hobo/hobo/blob/master/integration_tests/agility_bootstrap/README
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.0.pre1
1
+ 2.1.0.pre2
@@ -27,7 +27,7 @@ module ActiveRecord
27
27
  def raise_on_type_mismatch!(record)
28
28
  # Don't complain if the interface type of a polymorphic association doesn't exist
29
29
  klass = @reflection.klass rescue nil
30
- unless klass.nil? || record.is_a?(klass)
30
+ unless klass.nil? || record.is_a?(klass) || record.is_a?(Array)
31
31
  raise ActiveRecord::AssociationTypeMismatch, "#{@reflection.klass} expected, got #{record.class}"
32
32
  end
33
33
  end
@@ -103,8 +103,23 @@ module Hobo
103
103
 
104
104
  # --- has_many mass assignment support --- #
105
105
 
106
- def self.has_many_with_accessible(name, options={}, &block)
107
- has_many_without_accessible(name, options, &block)
106
+ def self.has_many_with_accessible(name, received_scope=nil, options={}, &block)
107
+ # Rails 4 supports a lambda as the second argument in a has_many association
108
+ # We need to support it too (required for gems like papertrail)
109
+ # The problem is that when it is not used, the options hash is taken as the scope
110
+ # To fix this, we make a small hack checking the second argument's class
111
+ if received_scope.is_a?(Proc)
112
+ has_many_without_accessible(name, received_scope, options, &block)
113
+ else
114
+ if received_scope == nil
115
+ options = {}
116
+ else
117
+ options = received_scope
118
+ end
119
+ has_many_without_accessible(name, options, &block)
120
+ end
121
+ # End of the received_scope hack
122
+
108
123
  if options[:accessible]
109
124
  class_eval %{
110
125
  def #{name}_with_accessible=(array_or_hash)
@@ -79,8 +79,8 @@ module Hobo
79
79
  # ensure active_user gets passed down to :dependent => destroy
80
80
  # associations (Ticket #528)
81
81
 
82
- def has_many_with_hobo_permission_check(association_id, options = {}, &extension)
83
- has_many_without_hobo_permission_check(association_id, options, &extension)
82
+ def has_many_with_hobo_permission_check(association_id, scope=nil, options = {}, &extension)
83
+ has_many_without_hobo_permission_check(association_id, scope, options, &extension)
84
84
  reflection = reflections[association_id]
85
85
  if reflection.options[:dependent]==:destroy
86
86
  #overriding dynamic method created in ActiveRecord::Associations#configure_dependency_for_has_many
@@ -91,8 +91,8 @@ module Hobo
91
91
  end
92
92
  end
93
93
 
94
- def has_one_with_hobo_permission_check(association_id, options = {}, &extension)
95
- has_one_without_hobo_permission_check(association_id, options, &extension)
94
+ def has_one_with_hobo_permission_check(association_id, scope=nil, options = {}, &extension)
95
+ has_one_without_hobo_permission_check(association_id, scope, options, &extension)
96
96
  reflection = reflections[association_id]
97
97
  if reflection.options[:dependent]==:destroy
98
98
  #overriding dynamic method created in ActiveRecord::Associations#configure_dependency_for_has_one
@@ -106,8 +106,8 @@ module Hobo
106
106
  end
107
107
  end
108
108
 
109
- def belongs_to_with_hobo_permission_check(association_id, options = {}, &extension)
110
- belongs_to_without_hobo_permission_check(association_id, options, &extension)
109
+ def belongs_to_with_hobo_permission_check(association_id, scope=nil, options = {}, &extension)
110
+ belongs_to_without_hobo_permission_check(association_id, scope, options, &extension)
111
111
  reflection = reflections[association_id]
112
112
  if reflection.options[:dependent]==:destroy
113
113
  #overriding dynamic method created in ActiveRecord::Associations#configure_dependency_for_belongs_to
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hobo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0.pre1
4
+ version: 2.1.0.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Locke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-18 00:00:00.000000000 Z
11
+ date: 2013-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hobo_support
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.1.0.pre1
19
+ version: 2.1.0.pre2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.1.0.pre1
26
+ version: 2.1.0.pre2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: hobo_fields
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 2.1.0.pre1
33
+ version: 2.1.0.pre2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 2.1.0.pre1
40
+ version: 2.1.0.pre2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: dryml
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 2.1.0.pre1
47
+ version: 2.1.0.pre2
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 2.1.0.pre1
54
+ version: 2.1.0.pre2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: hobo_will_paginate
57
57
  requirement: !ruby/object:Gem::Requirement