oldie_rails_models 0.0.7 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43a1ccec0aa08f9cb66093abcc0d6b0a8233108b
4
- data.tar.gz: c02eaf9487dff4ce716e2a1d148f022afe4a3d20
3
+ metadata.gz: 24ece9da8f35cafc77145cc9803d3e45ec33e194
4
+ data.tar.gz: 8b8bf9f587de439d8f815dd173a5a90691e4b527
5
5
  SHA512:
6
- metadata.gz: 65e1bb62c98319a75846f8291f04f6fa1d8f4f5776f028f3212406204ba01dbbc7bf07679eaddc99b48cb2851d94228f4d2653055ffc4140a2a26dc024447e9b
7
- data.tar.gz: 3147066a06f34b101fa79a815797504da80a249cebd15adcef712c47a2b7d8b8190945f4a3623ac9598f227ee4b038b534664cc4b3bbd79a4fabdf468c7aa2b9
6
+ metadata.gz: bbc4497a647a4810286d57df076c720eafc6e2a02579935ec79732de2e438b548de8e6620e5c1ade27027a582e407a53d772918debcca9e0b99bbbce2c221168
7
+ data.tar.gz: 9cf10a519d53b22e8cd4f3aae2a92519d4c2760054ccfe587d4994b7eabb7fce97b1fa4cfec77cc5c57742a4c98a6b42fa594833b146744f9f4a4094dfc3e3fd
@@ -0,0 +1,10 @@
1
+ module OldieRailsModels::Mailer
2
+
3
+ def self.method_missing(method_name, *args)
4
+ p "method_name #{method_name}"
5
+
6
+ super
7
+
8
+ end
9
+
10
+ end
@@ -0,0 +1,45 @@
1
+ module OldieRailsModels::Model
2
+
3
+ def named_scope(*args)
4
+ scope *args
5
+ end
6
+
7
+ def validate_on_create(*args)
8
+ args.last.merge(on: :create) if args.last.is_a?(Hash)
9
+ validate *args
10
+ end
11
+
12
+ def validate_on_update(*args)
13
+ args.last.merge(on: :update) if args.last.is_a?(Hash)
14
+ validate *args
15
+ end
16
+
17
+ def before_validation_on_create(*args)
18
+ args.last.merge(on: :create) if args.last.is_a?(Hash)
19
+ before_validation *args
20
+ end
21
+
22
+ def before_validation_on_update(*args)
23
+ args.last.merge(on: :update) if args.last.is_a?(Hash)
24
+ before_validation *args
25
+ end
26
+
27
+ def set_primary_key(*args)
28
+ # self.primary_key = *args
29
+ end
30
+
31
+ def set_table_name(*args)
32
+ self.table_name = *args
33
+ end
34
+
35
+ def conditions(*args)
36
+ where *args
37
+ end
38
+
39
+ def conditions(*args)
40
+ where *args
41
+ end
42
+
43
+ def attr_accessible(*args); end
44
+
45
+ end
@@ -1,3 +1,3 @@
1
1
  module OldieRailsModels
2
- VERSION = "0.0.7"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -1,44 +1,10 @@
1
- module OldieRailsModels
1
+ require 'oldie_rails_models/model'
2
+ require 'oldie_rails_models/mailer'
2
3
 
3
- def named_scope(*args)
4
- scope *args
5
- end
6
-
7
- def validate_on_create(*args)
8
- args.last.merge(on: :create) if args.last.is_a?(Hash)
9
- validate *args
10
- end
11
-
12
- def validate_on_update(*args)
13
- args.last.merge(on: :update) if args.last.is_a?(Hash)
14
- validate *args
15
- end
16
-
17
- def before_validation_on_create(*args)
18
- args.last.merge(on: :create) if args.last.is_a?(Hash)
19
- before_validation *args
20
- end
21
-
22
- def before_validation_on_update(*args)
23
- args.last.merge(on: :update) if args.last.is_a?(Hash)
24
- before_validation *args
25
- end
26
-
27
- def set_primary_key(*args)
28
- # self.primary_key = *args
29
- end
30
-
31
- def conditions(*args)
32
- where *args
33
- end
34
-
35
- def attr_accessible(*args); end
36
-
37
- end
38
4
 
39
5
  if defined? Rails
40
6
  ActiveSupport.on_load(:active_record) do
41
- extend OldieRailsModels
7
+ extend OldieRailsModels::Model
42
8
  end
43
9
 
44
10
  ActiveSupport.on_load(:action_controller) do
@@ -48,4 +14,5 @@ if defined? Rails
48
14
  end
49
15
  end
50
16
  end
17
+
51
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oldie_rails_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Dubovskoy
@@ -45,6 +45,8 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
+ - lib/oldie_rails_models/mailer.rb
49
+ - lib/oldie_rails_models/model.rb
48
50
  - lib/oldie_rails_models/version.rb
49
51
  - lib/oldie_rails_models.rb
50
52
  - MIT-LICENSE