jabysoft-rails_patterns 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c46cd9ef70ff757fff05724af9cb487cf28fde9d
|
4
|
+
data.tar.gz: 32a788a337bb55d5ab4bc7ebeb2951de778e07e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c41534f48df142a17d5cb7708cb605dc645f6bb8c07d3df7f20bbf2adae502710c591f9adff8d5201580d5e05a5c84b072f00519aad6fcd68aa500014ad4a13b
|
7
|
+
data.tar.gz: bcec448ca078cbc6179fa037f899c0cbd0e3c09c79ac6fdb21615474585b3a5358126c992b23383f04c5cc73323d31b9e12e4dec9b3a97a2a54075aaf69a6f4f
|
@@ -46,13 +46,17 @@ module Jabysoft
|
|
46
46
|
|
47
47
|
protected
|
48
48
|
# to be used by subclasses
|
49
|
-
def included_attributes
|
50
|
-
nil
|
51
|
-
end
|
49
|
+
def included_attributes;end
|
52
50
|
|
53
51
|
# to be used by subclasses
|
54
52
|
def load_form_resources;end
|
55
|
-
|
53
|
+
|
54
|
+
# to be used by subclasses
|
55
|
+
def after_create;end
|
56
|
+
|
57
|
+
# to be used by subclasses
|
58
|
+
def after_update;end
|
59
|
+
|
56
60
|
def model_class
|
57
61
|
get_model_name.singularize.constantize
|
58
62
|
end
|
@@ -112,7 +116,7 @@ module Jabysoft
|
|
112
116
|
|
113
117
|
def responds(action)
|
114
118
|
message = "after_#{action}".to_sym
|
115
|
-
return send(message) if respond_to?(message)
|
119
|
+
return send(message, variable.valid?) if respond_to?(message)
|
116
120
|
|
117
121
|
if controller_namespace
|
118
122
|
respond_with controller_namespace.to_sym, variable
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module Jabysoft
|
2
2
|
module ExtensionModelBehaviour
|
3
3
|
extend ActiveSupport::Concern
|
4
|
-
# It gives model additional scope active and
|
4
|
+
# It gives model additional scope active and combo.
|
5
5
|
|
6
6
|
included do
|
7
7
|
scope :active, -> { where(active: true) }
|
8
|
-
scope :
|
8
|
+
scope :combo, -> { select(:id, scoped_attribute) }
|
9
9
|
|
10
10
|
def self.scoped_attribute
|
11
11
|
return :title if column_names.include? 'title'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jabysoft-rails_patterns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emerson Xavier
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -142,6 +142,7 @@ files:
|
|
142
142
|
- app/helpers/render_helper.rb
|
143
143
|
- app/models/concerns/jabysoft/extension_model_behaviour.rb
|
144
144
|
- app/models/concerns/jabysoft/searchable_behaviour.rb
|
145
|
+
- app/models/jabysoft/base_model.rb
|
145
146
|
- app/services/jabysoft/authorisation_service.rb
|
146
147
|
- bin/console
|
147
148
|
- bin/setup
|