record_with_operator 0.0.22 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,34 +0,0 @@
1
- module AssociationWithOperator
2
-
3
- def find(*args)
4
- results = super
5
- if results.kind_of? Array
6
- results.each{|r| r.operator = proxy_owner.operator}
7
- else
8
- results.operator = proxy_owner.operator if results
9
- end
10
- results
11
- end
12
-
13
-
14
- def method_missing(method, *args)
15
- results = super
16
- unless ActiveRecord::NamedScope::Scope === results
17
- if results.respond_to?(:operator=)
18
- results.operator= proxy_owner.operator
19
- elsif results.kind_of? Array
20
- results.each{|r| r.operator = proxy_owner.operator if r.respond_to?(:operator=)}
21
- end
22
- end
23
- results
24
- end
25
-
26
- def construct_join_attributes(associate)
27
- join_attributes = super
28
- if @owner.operator || associate.operator
29
- join_attributes[:operator] ||= @owner.operator
30
- join_attributes[:operator] ||= associate.operator
31
- end
32
- join_attributes
33
- end
34
- end
@@ -1,4 +0,0 @@
1
- *.gem
2
- .bundle
3
- Gemfile.lock
4
- pkg/*
@@ -1,4 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- # Specify your gem's dependencies in record_with_operator.gemspec
4
- gemspec
@@ -1,2 +0,0 @@
1
- require 'bundler'
2
- Bundler::GemHelper.install_tasks
@@ -1,3 +0,0 @@
1
- module RecordWithOperator
2
- VERSION = "0.0.1"
3
- end
@@ -1,3 +0,0 @@
1
- module RecordWithOperator
2
- # Your code goes here...
3
- end
@@ -1,21 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "record_with_operator/version"
4
-
5
- Gem::Specification.new do |s|
6
- s.name = "record_with_operator"
7
- s.version = RecordWithOperator::VERSION
8
- s.platform = Gem::Platform::RUBY
9
- s.authors = ["TODO: Write your name"]
10
- s.email = ["TODO: Write your email address"]
11
- s.homepage = ""
12
- s.summary = %q{TODO: Write a gem summary}
13
- s.description = %q{TODO: Write a gem description}
14
-
15
- s.rubyforge_project = "record_with_operator"
16
-
17
- s.files = `git ls-files`.split("\n")
18
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
- s.require_paths = ["lib"]
21
- end