has-relationship 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,47 +1,3 @@
1
- begin
2
- # Rspec 1.3.0
3
- require 'spec/rake/spectask'
4
-
5
- desc 'Default: run specs'
6
- task :default => :spec
7
- Spec::Rake::SpecTask.new do |t|
8
- t.spec_files = FileList["spec/**/*_spec.rb"]
9
- end
10
-
11
- Spec::Rake::SpecTask.new('rcov') do |t|
12
- t.spec_files = FileList["spec/**/*_spec.rb"]
13
- t.rcov = true
14
- t.rcov_opts = ['--exclude', 'spec']
15
- end
16
-
17
- rescue LoadError
18
- # Rspec 2.0
19
- require 'rspec/core/rake_task'
20
-
21
- desc 'Default: run specs'
22
- task :default => :spec
23
- Rspec::Core::RakeTask.new do |t|
24
- t.pattern = "spec/**/*_spec.rb"
25
- end
26
-
27
- Rspec::Core::RakeTask.new('rcov') do |t|
28
- t.pattern = "spec/**/*_spec.rb"
29
- t.rcov = true
30
- t.rcov_opts = ['--exclude', 'spec']
31
- end
32
-
33
- rescue LoadError
34
- puts "Rspec not available. Install it with: gem install rspec"
35
- end
36
-
37
- namespace 'rails2.3' do
38
- task :spec do
39
- gemfile = File.join(File.dirname(__FILE__), 'lib', 'has_relationship', 'compatibility', 'Gemfile')
40
- ENV['BUNDLE_GEMFILE'] = gemfile
41
- Rake::Task['spec'].invoke
42
- end
43
- end
44
-
45
1
  begin
46
2
  require 'jeweler'
47
3
  Jeweler::Tasks.new do |gemspec|
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.8
1
+ 0.0.9
@@ -30,7 +30,7 @@ module HasRelationship
30
30
 
31
31
  relationships = relationship.kind_of?(Array) ? relationship : [relationship]
32
32
 
33
- relationship_through = options[:singular] ? "relationship_through_#{relationships.join("_").to_s.tableize.singularize}".to_sym : "relationship_through_#{relationships.join("_").to_s.tableize}".to_sym
33
+ relationship_through = options[:singular] ? ("#{self.to_s}_#{resource_name}").to_s.tableize.singularize.to_sym : ("#{self.to_s}_#{resource_name}").to_s.tableize.to_sym
34
34
 
35
35
  class_eval do
36
36
  through_conditions = (relationship.kind_of?(Array) ? nil : {:relationship => relationship})
@@ -81,7 +81,7 @@ module HasRelationship
81
81
 
82
82
  relationships = relationship.kind_of?(Array) ? relationship : [relationship]
83
83
 
84
- relationship_through = options[:singular] ? "inverse_relationship_through_#{relationships.join("_").to_s.tableize.singularize}".to_sym : "inverse_relationship_through_#{relationships.join("_").to_s.tableize}".to_sym
84
+ relationship_through = options[:singular] ? ("#{self.to_s}_#{resource_name}").to_s.tableize.singularize.to_sym : ("#{self.to_s}_#{resource_name}").to_s.tableize.to_sym
85
85
 
86
86
  class_eval do
87
87
  through_conditions = (relationship.kind_of?(Array) ? nil : {:relationship => relationship})
@@ -1 +1 @@
1
- require 'has-relationship'
1
+ require 'has-relationship'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has-relationship
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
5
- prerelease: false
4
+ hash: 13
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 8
10
- version: 0.0.8
9
+ - 9
10
+ version: 0.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andrew Hunter
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-29 00:00:00 -04:00
18
+ date: 2011-07-19 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  requirements: []
68
68
 
69
69
  rubyforge_project:
70
- rubygems_version: 1.3.7
70
+ rubygems_version: 1.6.2
71
71
  signing_key:
72
72
  specification_version: 3
73
73
  summary: has_relationship is an easy way to instantly create an association between any two database tables