acts-as-joinable 0.1.6.1 → 0.1.6.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'rake/gempackagetask'
5
5
  spec = Gem::Specification.new do |s|
6
6
  s.name = "acts-as-joinable"
7
7
  s.authors = ["Lance Pollard"]
8
- s.version = "0.1.6.1"
8
+ s.version = "0.1.6.2"
9
9
  s.summary = "ActsAsJoinable: DRYing up Many-to-Many Relationships in ActiveRecord"
10
10
  s.homepage = "http://github.com/viatropos/acts-as-joinable"
11
11
  s.email = "lancejpollard@gmail.com"
@@ -112,6 +112,7 @@ module ActiveRecord
112
112
  else
113
113
  { reflection.primary_key_name => owner_quoted_id }
114
114
  end
115
+
115
116
  end
116
117
 
117
118
  def construct_joins(custom_joins = nil)
@@ -179,6 +179,11 @@ module ActsAsJoinable
179
179
  end
180
180
  define_method "#{singular_type}=" do |value|
181
181
  #send(relationship_with_context).delete_all
182
+
183
+ #send(relationship_with_context).delete_all
184
+ #send(plural_type).each do |object|
185
+ # send(plural_type).delete(object)
186
+ #end
182
187
  unless value.blank?
183
188
  send(plural_type) << value
184
189
  end
data/test/lib/group.rb CHANGED
@@ -4,4 +4,5 @@ class Group < ActiveRecord::Base
4
4
  joins :photos, :source => :asset, :context => "photos"
5
5
  joins :custom_photos, :source => :asset, :context => "custom"
6
6
  joins :nesteds, :source => :sub_group, :context => :nested
7
+ #joins_one :manager, :child => {}
7
8
  end
data/test/lib/role.rb ADDED
@@ -0,0 +1,3 @@
1
+ class Role < ActiveRecord::Base
2
+ joinable
3
+ end
data/test/lib/user.rb ADDED
@@ -0,0 +1,3 @@
1
+ class User < ActiveRecord::Base
2
+ joins :roles
3
+ end
@@ -86,6 +86,14 @@ class ActsAsJoinableTest < ActiveRecord::TestCase
86
86
  assert_equal 0, ActsAsJoinable::Relationship.count
87
87
  end
88
88
 
89
+ context "follow validation conventions" do
90
+
91
+ end
92
+
93
+ context "find by join model" do
94
+
95
+ end
96
+
89
97
  teardown do
90
98
  destroy_models
91
99
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts-as-joinable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 93
4
+ hash: 91
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
9
  - 6
10
- - 1
11
- version: 0.1.6.1
10
+ - 2
11
+ version: 0.1.6.2
12
12
  platform: ruby
13
13
  authors:
14
14
  - Lance Pollard
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-09-30 00:00:00 -05:00
19
+ date: 2010-10-04 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies: []
22
22
 
@@ -42,8 +42,10 @@ files:
42
42
  - test/lib/group.rb
43
43
  - test/lib/page.rb
44
44
  - test/lib/post.rb
45
+ - test/lib/role.rb
45
46
  - test/lib/sub_group.rb
46
47
  - test/lib/tag.rb
48
+ - test/lib/user.rb
47
49
  - test/test_acts_as_joinable.rb
48
50
  - test/test_helper.rb
49
51
  - app/models/relationship.rb