padrino-contrib 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of padrino-contrib might be problematic. Click here for more details.
@@ -14,9 +14,10 @@ module Padrino
|
|
14
14
|
# end
|
15
15
|
#
|
16
16
|
module Permalink
|
17
|
+
extend ActiveSupport::Concern
|
18
|
+
|
17
19
|
module ClassMethods
|
18
20
|
def has_permalink(field)
|
19
|
-
include InstanceMethods
|
20
21
|
class_inheritable_accessor :permalink_field
|
21
22
|
write_inheritable_attribute :permalink_field, field
|
22
23
|
before_save :generate_permalink
|
@@ -47,4 +48,4 @@ module Padrino
|
|
47
48
|
end # Orm
|
48
49
|
end # Contrib
|
49
50
|
end # Padrino
|
50
|
-
MongoMapper::Document.
|
51
|
+
MongoMapper::Document.send(:include, Padrino::Contrib::Orm::Mm::Permalink)
|
@@ -2,19 +2,21 @@ module Padrino
|
|
2
2
|
module Contrib
|
3
3
|
module Orm
|
4
4
|
module Mm
|
5
|
+
##
|
6
|
+
# This module provides full text search in specified fileds with pagination support.
|
7
|
+
#
|
8
|
+
# == Examples
|
9
|
+
#
|
10
|
+
# # model.rb
|
11
|
+
# has_search :title, :body
|
12
|
+
#
|
13
|
+
# # controller.rb
|
14
|
+
# Model.search("some thing")
|
15
|
+
# Model.search("some thing", :order => "position", :page => (params[:page] || 1), :draft => false, :paginate => true)
|
16
|
+
#
|
5
17
|
module Search
|
6
|
-
|
7
|
-
|
8
|
-
#
|
9
|
-
# == Examples
|
10
|
-
#
|
11
|
-
# # model.rb
|
12
|
-
# has_search :title, :body
|
13
|
-
#
|
14
|
-
# # controller.rb
|
15
|
-
# Model.search("some thing")
|
16
|
-
# Model.search("some thing", :order => "position", :page => (params[:page] || 1), :draft => false, :paginate => true)
|
17
|
-
#
|
18
|
+
extend ActiveSupport::Concern
|
19
|
+
|
18
20
|
module ClassMethods
|
19
21
|
def has_search(*fields)
|
20
22
|
class_inheritable_accessor :search_fields
|
@@ -35,4 +37,4 @@ module Padrino
|
|
35
37
|
end # Orm
|
36
38
|
end # Contrib
|
37
39
|
end # Padrino
|
38
|
-
MongoMapper::Document.
|
40
|
+
MongoMapper::Document.send(:include, Padrino::Contrib::Orm::Mm::Search)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: padrino-contrib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 6
|
10
|
+
version: 0.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Padrino Team
|