railhead_autouser 0.1.4 → 0.1.5

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5942493dd39628326fa4e9b603db83fa24ec2135
4
+ data.tar.gz: f34f1cd70ce0cb2950c71726cadacfd69bfc8428
5
+ SHA512:
6
+ metadata.gz: 1ceea1d6940d31c7ac370220944f8c54f0ee7479cee22b1fb7a665c93cb31987556b791136053be777ebb54ec3a7bc1698be31cf5435176fcaa1348f7f226d20
7
+ data.tar.gz: 575d8b23642d9bce8a3c311a6663b2224cce58d7458c0942aae2e2b48dfa5c21bc9362fab618a623c0fd982ae2bb200b56b5c56b5abe7b8f354fa6f5f05f481c
@@ -1,4 +1,11 @@
1
+ unless defined?(ActionController::Caching::Sweeper)
2
+ require 'rails/observers/activerecord/active_record'
3
+ require 'rails/observers/action_controller/caching'
4
+ end
5
+
6
+
1
7
  module RailheadAutoUserModel
8
+
2
9
  def self.included(base)
3
10
  base.class_eval do
4
11
  add_observer(RailheadAutoUserSweeper.instance)
@@ -6,7 +13,9 @@ module RailheadAutoUserModel
6
13
  end
7
14
  end
8
15
 
16
+
9
17
  module RailheadAutoUserController
18
+
10
19
  def auto_user
11
20
  class_eval do
12
21
  cache_sweeper :railhead_auto_user_sweeper
@@ -14,11 +23,14 @@ module RailheadAutoUserController
14
23
  end
15
24
  end
16
25
 
26
+
17
27
  class RailheadAutoUserSweeper < ActionController::Caching::Sweeper
28
+
18
29
  def before_save(record)
19
30
  record.user_id = current_user.id if current_user and record.respond_to?(:user_id) and record.new_record? and record.user_id.nil?
20
31
  end
21
32
  end
22
33
 
34
+
23
35
  ActiveRecord::Base.send :include, RailheadAutoUserModel
24
36
  ActionController::Base.send :extend, RailheadAutoUserController
@@ -1,11 +1,11 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "railhead_autouser"
3
- s.version = "0.1.4"
4
- s.date = "2009-10-22"
3
+ s.version = "0.1.5"
4
+ s.date = "2014-12-04"
5
5
  s.summary = "RailheadAutoUser is a Ruby on Rails plugin that automatically adds current_user to models."
6
6
  s.email = "nagybence@tipogral.hu"
7
7
  s.homepage = "http://github.com/nagybence/railhead_autouser"
8
- s.description = "RailheadAutoUser is a Ruby on Rails plugin that automatically adds current_user to modelsk."
8
+ s.description = "RailheadAutoUser is a Ruby on Rails plugin that automatically adds current_user to models."
9
9
  s.has_rdoc = true
10
10
  s.authors = ["Bence Nagy"]
11
11
  s.files = ["MIT-LICENSE",
metadata CHANGED
@@ -1,60 +1,52 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: railhead_autouser
3
- version: !ruby/object:Gem::Version
4
- version: 0.1.4
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.5
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Bence Nagy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
-
12
- date: 2009-10-22 00:00:00 +02:00
13
- default_executable:
11
+ date: 2014-12-04 00:00:00.000000000 Z
14
12
  dependencies: []
15
-
16
- description: RailheadAutoUser is a Ruby on Rails plugin that automatically adds current_user to modelsk.
13
+ description: RailheadAutoUser is a Ruby on Rails plugin that automatically adds current_user
14
+ to models.
17
15
  email: nagybence@tipogral.hu
18
16
  executables: []
19
-
20
17
  extensions: []
21
-
22
- extra_rdoc_files:
18
+ extra_rdoc_files:
23
19
  - README.rdoc
24
- files:
20
+ files:
25
21
  - MIT-LICENSE
26
22
  - README.rdoc
27
23
  - init.rb
28
- - railhead_autouser.gemspec
29
24
  - lib/railhead_autouser.rb
30
- has_rdoc: true
25
+ - railhead_autouser.gemspec
31
26
  homepage: http://github.com/nagybence/railhead_autouser
32
27
  licenses: []
33
-
28
+ metadata: {}
34
29
  post_install_message:
35
- rdoc_options:
36
- - --main
30
+ rdoc_options:
31
+ - "--main"
37
32
  - README.rdoc
38
- require_paths:
33
+ require_paths:
39
34
  - lib
40
- required_ruby_version: !ruby/object:Gem::Requirement
41
- requirements:
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ requirements:
42
37
  - - ">="
43
- - !ruby/object:Gem::Version
44
- version: "0"
45
- version:
46
- required_rubygems_version: !ruby/object:Gem::Requirement
47
- requirements:
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
41
+ requirements:
48
42
  - - ">="
49
- - !ruby/object:Gem::Version
50
- version: "0"
51
- version:
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
52
45
  requirements: []
53
-
54
46
  rubyforge_project:
55
- rubygems_version: 1.3.5
47
+ rubygems_version: 2.2.2
56
48
  signing_key:
57
- specification_version: 3
58
- summary: RailheadAutoUser is a Ruby on Rails plugin that automatically adds current_user to models.
49
+ specification_version: 4
50
+ summary: RailheadAutoUser is a Ruby on Rails plugin that automatically adds current_user
51
+ to models.
59
52
  test_files: []
60
-