cowtech-rails 2.0.0.2 → 2.1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,18 +13,23 @@ module Cowtech
13
13
  @application_info
14
14
  end
15
15
 
16
+ def full_controller_name(css = false)
17
+ rv = self.controller_path
18
+ !css ? rv : rv.gsub("/", "_")
19
+ end
20
+
16
21
  def location_name(action = nil, controller = nil)
17
- controller = self.controller_name if !controller
22
+ controller = self.full_controller_name if !controller
18
23
  action = self.action_name if !action
19
24
  "#{controller}##{action}"
20
25
  end
21
26
 
22
27
  def additional_tag(what = :js, *args)
23
28
  if what == :js then
24
- args.insert(0, "app/#{self.controller_name}.js")
29
+ args.insert(0, "app/#{self.full_controller_name}.js")
25
30
  javascript_include_tag(*args)
26
31
  elsif what == :css then
27
- args.insert(0, "app/#{self.controller_name}.css")
32
+ args.insert(0, "app/#{self.full_controller_name}.css")
28
33
  stylesheet_link_tag(*args)
29
34
  end
30
35
  end
@@ -66,7 +66,15 @@ module Cowtech
66
66
 
67
67
  def mongo_add_query_conditions(args = {})
68
68
  (args[:conditions] || []).ensure_array.each do |condition|
69
- @mongo_query = @mongo_query.where(condition) if condition.is_a?(Hash)
69
+ if condition.is_a?(Hash) then
70
+ condition.each_pair do |key, val|
71
+ if key == "$or" then
72
+ @mongo_query = @mongo_query.any_of(val)
73
+ else
74
+ @mongo_query = @mongo_query.where({key => val})
75
+ end
76
+ end
77
+ end
70
78
  end
71
79
 
72
80
  @mongo_query = yield(@mongo_query) if block_given?
@@ -109,7 +117,7 @@ module Cowtech
109
117
  parameter = args[:parameter] || :search
110
118
 
111
119
  # Get the query
112
- search_query = params[parameter]
120
+ search_query = args[:query] || params[parameter]
113
121
  if search_query.present? then
114
122
  expr = self.mongo_parse_search(search_query)
115
123
 
@@ -8,9 +8,9 @@ module Cowtech
8
8
  module Rails
9
9
  module Version
10
10
  MAJOR = 2
11
- MINOR = 0
11
+ MINOR = 1
12
12
  PATCH = 0
13
- BUILD = 2
13
+ BUILD = 1
14
14
 
15
15
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
16
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cowtech-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.2
4
+ version: 2.1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-13 00:00:00.000000000Z
12
+ date: 2011-09-20 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cowtech-extensions
16
- requirement: &70308086256600 !ruby/object:Gem::Requirement
16
+ requirement: &70285157001040 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70308086256600
24
+ version_requirements: *70285157001040
25
25
  description: A general purpose Rails utility plugin.
26
26
  email: shogun_panda@me.com
27
27
  executables: []