mh_extensions 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,5 @@
1
+ = Version 0.1.4
2
+ * Added default assigment for updated_by when created_by is assigned
1
3
  = Version 0.1.3
2
4
  * Fixes for homepage url
3
5
  = Version 0.1.2
data/Manifest CHANGED
@@ -5,6 +5,7 @@ Manifest
5
5
  README.md
6
6
  Rakefile
7
7
  init.rb
8
+ lib/activerecord_ext.rb
8
9
  lib/acts_as_tree_ext.rb
9
10
  lib/array.rb
10
11
  lib/browser_detector.rb
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('mh_extensions', '0.1.3') do |p|
5
+ Echoe.new('mh_extensions', '0.1.4') do |p|
6
6
  p.description = "Package of usefull ruby basic classes (and not only) extensions"
7
7
  p.url = "https://github.com/mensfeld/MH-Extensions"
8
8
  p.author = "Maciej Mensfeld"
@@ -0,0 +1,32 @@
1
+ module ArMH
2
+ module Extensions
3
+
4
+ def self.included(base)
5
+ base.extend AddActsAsMethod
6
+ end
7
+
8
+ module AddActsAsMethod
9
+
10
+ # Should new element be first || last
11
+ def mh_extensions(*sources)
12
+ class_eval <<-END
13
+ include ArMH::Extensions::InstanceMethods
14
+ END
15
+
16
+ if self.column_names.include?('created_by') && self.column_names.include?('updated_by')
17
+ self.send(:define_method, "created_by=".to_sym) do |author|
18
+ self.updated_by=author if self.updated_by.nil? || self.updated_by.length == 0
19
+ super
20
+ end
21
+ end
22
+ end
23
+ end
24
+
25
+ module InstanceMethods
26
+ end
27
+ end
28
+ end
29
+
30
+ ActiveRecord::Base.send(:include, ArMH::Extensions)
31
+
32
+
@@ -8,3 +8,5 @@ require "string_ext"
8
8
  require "browser_detector"
9
9
  require "txt_file_handler"
10
10
  require "acts_as_tree_ext"
11
+ require "activerecord_ext"
12
+
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{mh_extensions}
5
- s.version = "0.1.3"
5
+ s.version = "0.1.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Maciej Mensfeld"]
@@ -10,8 +10,8 @@ Gem::Specification.new do |s|
10
10
  s.date = %q{2011-04-17}
11
11
  s.description = %q{Package of usefull ruby basic classes (and not only) extensions}
12
12
  s.email = %q{maciej@mensfeld.pl}
13
- s.extra_rdoc_files = ["CHANGELOG.rdoc", "README.md", "lib/acts_as_tree_ext.rb", "lib/array.rb", "lib/browser_detector.rb", "lib/date_ext.rb", "lib/hash.rb", "lib/mh_extensions.rb", "lib/rand.rb", "lib/range.rb", "lib/string.rb", "lib/string_ext.rb", "lib/txt_file_handler.rb"]
14
- s.files = ["CHANGELOG.rdoc", "Gemfile", "MIT-LICENSE", "Manifest", "README.md", "Rakefile", "init.rb", "lib/acts_as_tree_ext.rb", "lib/array.rb", "lib/browser_detector.rb", "lib/date_ext.rb", "lib/hash.rb", "lib/mh_extensions.rb", "lib/rand.rb", "lib/range.rb", "lib/string.rb", "lib/string_ext.rb", "lib/txt_file_handler.rb", "mh_extensions.gemspec"]
13
+ s.extra_rdoc_files = ["CHANGELOG.rdoc", "README.md", "lib/activerecord_ext.rb", "lib/acts_as_tree_ext.rb", "lib/array.rb", "lib/browser_detector.rb", "lib/date_ext.rb", "lib/hash.rb", "lib/mh_extensions.rb", "lib/rand.rb", "lib/range.rb", "lib/string.rb", "lib/string_ext.rb", "lib/txt_file_handler.rb"]
14
+ s.files = ["CHANGELOG.rdoc", "Gemfile", "MIT-LICENSE", "Manifest", "README.md", "Rakefile", "init.rb", "lib/activerecord_ext.rb", "lib/acts_as_tree_ext.rb", "lib/array.rb", "lib/browser_detector.rb", "lib/date_ext.rb", "lib/hash.rb", "lib/mh_extensions.rb", "lib/rand.rb", "lib/range.rb", "lib/string.rb", "lib/string_ext.rb", "lib/txt_file_handler.rb", "mh_extensions.gemspec"]
15
15
  s.homepage = %q{https://github.com/mensfeld/MH-Extensions}
16
16
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Mh_extensions", "--main", "README.md"]
17
17
  s.require_paths = ["lib"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: mh_extensions
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.3
5
+ version: 0.1.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Maciej Mensfeld
@@ -44,6 +44,7 @@ extensions: []
44
44
  extra_rdoc_files:
45
45
  - CHANGELOG.rdoc
46
46
  - README.md
47
+ - lib/activerecord_ext.rb
47
48
  - lib/acts_as_tree_ext.rb
48
49
  - lib/array.rb
49
50
  - lib/browser_detector.rb
@@ -63,6 +64,7 @@ files:
63
64
  - README.md
64
65
  - Rakefile
65
66
  - init.rb
67
+ - lib/activerecord_ext.rb
66
68
  - lib/acts_as_tree_ext.rb
67
69
  - lib/array.rb
68
70
  - lib/browser_detector.rb
metadata.gz.sig CHANGED
Binary file