resources 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: 675b643956ffc8d2fc4b55379c96a6c9d1d680a7
|
4
|
+
data.tar.gz: 193ae7c9cb4a678e2c7eab93e1ee28ab3e736232
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c882d9779f848bf089bdd9aecfcd9a717bc455c72c64c16bad6d8649d00626cfb85cac99026e7481f4ee6e13b34ae4f12b85f0a15e86fe6ce5ceeee5a66fc1e1
|
7
|
+
data.tar.gz: ea675bf6b1c9d4bc12ada513f1792967f67a3c411b075e3c3788fa6f3b0bb10d7a056d973c30fa44a00a49e8b7b8e9d337b8cb708dbe69667e03ee73dd2df4d0
|
@@ -2,7 +2,7 @@
|
|
2
2
|
Resources.config do |config|
|
3
3
|
|
4
4
|
config.rest_actions = true # Enable restful actions (index,new, create, etc)
|
5
|
-
config.search = false # Enable ransack search object (resources_search)
|
5
|
+
config.search = false # Enable ransack search object (resources_search)
|
6
6
|
config.search_options = {distinct: false} # ransack result options. Default {distinct: false}
|
7
7
|
|
8
8
|
# Setting Params (params_search, params_resource, etc)
|
@@ -23,8 +23,8 @@ Resources.config do |config|
|
|
23
23
|
|
24
24
|
# Setting alias method of resource, if you change the value to, for example :country you will gain this extra helper methods:
|
25
25
|
# countries for the collection object
|
26
|
-
# country for the resource object
|
26
|
+
# country for the resource object
|
27
27
|
# country_saved? to know if the resource was saved
|
28
28
|
config.resource_method_name = :resource # alias method of resource
|
29
|
-
config.resources_method_name =
|
30
|
-
end
|
29
|
+
config.resources_method_name = :resources # alias method of resources, if you dont specify one it takes "resource_method_name.to_s.pluralize"
|
30
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Resources
|
2
2
|
class Configuration
|
3
|
-
|
4
|
-
def initialize *args
|
3
|
+
|
4
|
+
def initialize *args
|
5
5
|
options = args.extract_options!
|
6
6
|
self.rest_actions = options[:rest_actions] || true
|
7
7
|
self.search = options[:search] || false
|
@@ -14,7 +14,7 @@ module Resources
|
|
14
14
|
self.resources_scope = options[:resources_scope] || nil
|
15
15
|
self.resource_method_name = options[:resource_method_name] || :resource
|
16
16
|
self.resources_method_name = options[:resources_method_name] || nil
|
17
|
-
if self.resource_method_name && self.resources_method_name.to_s.blank?
|
17
|
+
if self.resource_method_name && self.resources_method_name.to_s.blank?
|
18
18
|
self.resources_method_name = self.resource_method_name.to_s.pluralize
|
19
19
|
end
|
20
20
|
end
|
@@ -31,16 +31,16 @@ module Resources
|
|
31
31
|
def self.accessors
|
32
32
|
[:rest_actions, :search, :search_options, :params_search, :resource_class_name, :resource_scope, :resources_scope, :resource_method_name, :resources_method_name, :params_resource, :pagination, :params_page]
|
33
33
|
end
|
34
|
-
accessors.map{|a| attr_accessor a }
|
34
|
+
accessors.map{|a| attr_accessor a }
|
35
35
|
|
36
36
|
|
37
37
|
end
|
38
38
|
|
39
|
-
Config = Resources::Configuration.new()
|
39
|
+
Config = Resources::Configuration.new()
|
40
40
|
|
41
|
-
def self.config(&block)
|
42
|
-
yield(Config)
|
41
|
+
def self.config(&block)
|
42
|
+
yield(Config)
|
43
43
|
end
|
44
44
|
|
45
|
-
|
46
|
-
end
|
45
|
+
|
46
|
+
end
|
data/lib/resources/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resources
|
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
|
- Emilio Forrer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: It's a gem that help's you to create CRUD controllers for your models
|
14
14
|
in a very fast and flexible way.
|
@@ -137,3 +137,4 @@ test_files:
|
|
137
137
|
- test/dummy/app/helpers/application_helper.rb
|
138
138
|
- test/dummy/README.rdoc
|
139
139
|
- test/test_helper.rb
|
140
|
+
has_rdoc:
|