merb-admin 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/VERSION +1 -1
- data/lib/activerecord_support.rb +4 -6
- data/lib/datamapper_support.rb +4 -6
- data/lib/merb-admin.rb +1 -1
- data/merb-admin.gemspec +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -11,7 +11,7 @@ http://github.com/sferik/merb-admin/raw/master/screenshots/edit.png
|
|
11
11
|
== Installation
|
12
12
|
$ gem install merb-admin -s http://gemcutter.org
|
13
13
|
In your app, add the following dependency to <tt>config/dependencies.rb</tt>:
|
14
|
-
dependency "merb-admin", "0.7.
|
14
|
+
dependency "merb-admin", "0.7.2"
|
15
15
|
Add the following route to <tt>config/router.rb</tt>:
|
16
16
|
add_slice(:merb_admin, :path_prefix => "admin")
|
17
17
|
Then, run the following rake task:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.2
|
data/lib/activerecord_support.rb
CHANGED
@@ -14,13 +14,11 @@ module MerbAdmin
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def first(options = {})
|
17
|
-
merge_order
|
18
|
-
model.first(options).extend(InstanceMethods)
|
17
|
+
model.first(merge_order(options)).extend(InstanceMethods)
|
19
18
|
end
|
20
19
|
|
21
20
|
def all(options = {})
|
22
|
-
merge_order
|
23
|
-
model.all(options)
|
21
|
+
model.all(merge_order(options))
|
24
22
|
end
|
25
23
|
|
26
24
|
def paginated(options = {})
|
@@ -98,10 +96,10 @@ module MerbAdmin
|
|
98
96
|
|
99
97
|
private
|
100
98
|
|
101
|
-
def merge_order
|
99
|
+
def merge_order(options)
|
102
100
|
@sort ||= options.delete(:sort) || "id"
|
103
101
|
@sort_order ||= options.delete(:sort_reverse) ? "desc" : "asc"
|
104
|
-
options.merge
|
102
|
+
options.merge(:order => ["#{@sort} #{@sort_order}"])
|
105
103
|
end
|
106
104
|
|
107
105
|
def association_parent_model_lookup(association)
|
data/lib/datamapper_support.rb
CHANGED
@@ -14,13 +14,11 @@ module MerbAdmin
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def first(options = {})
|
17
|
-
merge_order
|
18
|
-
model.first(options).extend(InstanceMethods)
|
17
|
+
model.first(merge_order(options)).extend(InstanceMethods)
|
19
18
|
end
|
20
19
|
|
21
20
|
def all(options = {})
|
22
|
-
merge_order
|
23
|
-
model.all(options)
|
21
|
+
model.all(merge_order(options))
|
24
22
|
end
|
25
23
|
|
26
24
|
def paginated(options = {})
|
@@ -96,10 +94,10 @@ module MerbAdmin
|
|
96
94
|
|
97
95
|
private
|
98
96
|
|
99
|
-
def merge_order
|
97
|
+
def merge_order(options)
|
100
98
|
@sort ||= options.delete(:sort) || :id
|
101
99
|
@sort_order ||= options.delete(:sort_reverse) ? :desc : :asc
|
102
|
-
options.merge
|
100
|
+
options.merge(:order => [@sort.to_sym.send(@sort_order)])
|
103
101
|
end
|
104
102
|
|
105
103
|
def association_type_lookup(association)
|
data/lib/merb-admin.rb
CHANGED
@@ -24,7 +24,7 @@ if defined?(Merb::Plugins)
|
|
24
24
|
|
25
25
|
# Slice metadata
|
26
26
|
self.description = "MerbAdmin is a Merb plugin that provides an easy-to-use interface for managing your data."
|
27
|
-
self.version = "0.7.
|
27
|
+
self.version = "0.7.2"
|
28
28
|
self.author = "Erik Michaels-Ober"
|
29
29
|
|
30
30
|
# Stub classes loaded hook - runs before LoadClasses BootLoader
|
data/merb-admin.gemspec
CHANGED