nay-record_with_operator 0.0.16 → 0.0.17

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.
Files changed (3) hide show
  1. data/Rakefile +1 -1
  2. data/lib/record_with_operator.rb +4 -4
  3. metadata +6 -5
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ DESCRIPTION = "Rails plugin to set created_by, updated_by, deleted_by to ActiveR
12
12
  GITHUB_PROJECT = "record_with_operator"
13
13
  HOMEPAGE = "http://github.com/nay/#{GITHUB_PROJECT}/tree"
14
14
  BIN_FILES = %w( )
15
- VER = "0.0.16"
15
+ VER = "0.0.17"
16
16
  CLEAN.include ['pkg']
17
17
 
18
18
  desc 'Default: run unit tests.'
@@ -1,6 +1,6 @@
1
1
  module RecordWithOperator
2
2
  def self.config
3
- @config ||= {:user_class_name => "User"}
3
+ @config ||= {:user_class_name => "User", :operator_assoication_options => {}}
4
4
  @config
5
5
  end
6
6
 
@@ -23,9 +23,9 @@ module RecordWithOperator
23
23
  @operator_associations_created = true
24
24
 
25
25
  if self.table_exists?
26
- belongs_to :creator, :foreign_key => "created_by", :class_name => RecordWithOperator.config[:user_class_name] if column_names.include?('created_by')
27
- belongs_to :updater, :foreign_key => "updated_by", :class_name => RecordWithOperator.config[:user_class_name] if column_names.include?('updated_by')
28
- belongs_to :deleter, :foreign_key => "deleted_by", :class_name => RecordWithOperator.config[:user_class_name] if column_names.include?('deleted_by')
26
+ belongs_to :creator, {:foreign_key => "created_by", :class_name => RecordWithOperator.config[:user_class_name]}.merge(RecordWithOperator.config[:operator_association_options]) if column_names.include?('created_by')
27
+ belongs_to :updater, {:foreign_key => "updated_by", :class_name => RecordWithOperator.config[:user_class_name]}.merge(RecordWithOperator.config[:operator_association_options]) if column_names.include?('updated_by')
28
+ belongs_to :deleter, {:foreign_key => "deleted_by", :class_name => RecordWithOperator.config[:user_class_name]}.merge(RecordWithOperator.config[:operator_association_options]) if column_names.include?('deleted_by')
29
29
  end
30
30
  end
31
31
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nay-record_with_operator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasuko Ohba
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-14 00:00:00 -07:00
12
+ date: 2009-08-18 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -49,8 +49,9 @@ files:
49
49
  - test/schema.rb
50
50
  - test/test_helper.rb
51
51
  - test/database.yml
52
- has_rdoc: true
52
+ has_rdoc: false
53
53
  homepage: http://github.com/nay/record_with_operator/tree
54
+ licenses:
54
55
  post_install_message:
55
56
  rdoc_options:
56
57
  - --line-numbers
@@ -72,9 +73,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
73
  requirements: []
73
74
 
74
75
  rubyforge_project:
75
- rubygems_version: 1.2.0
76
+ rubygems_version: 1.3.5
76
77
  signing_key:
77
- specification_version: 2
78
+ specification_version: 3
78
79
  summary: Rails plugin to set created_by, updated_by, deleted_by to ActiveRecord objects. Supports associations.
79
80
  test_files:
80
81
  - test/record_with_operator_belongs_to_association_test.rb