lolita-menu 0.4.1 → 0.4.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: 12f02cc75cb19a53fabd98dcbbf60884a8f90a0c
4
- data.tar.gz: b1c00ff233f2e88544dbad136e5d7c3ecf2147fd
3
+ metadata.gz: 505f225fb1ed4299ce82086783862ce90eec17a1
4
+ data.tar.gz: 631d0731cd47d52dca9a4d9ec05eb2d187909706
5
5
  SHA512:
6
- metadata.gz: 3d4f87a3719df14431bf739476f99d79b3788474cee160a4893b88633761eb309ec6e072327e2c0eca36c30a11fb92378cde9e12b0b9ce467dd510883fdfaea3
7
- data.tar.gz: 5b10de0d6a8da8b5979a53751d8da873132a77720ddd3e73f3b5988e60946c788297bda52e0687d92e2c12f8fa23a6b35b23ba57227dbd9a2e166873c1652f48
6
+ metadata.gz: cd594e5a46d9e5d985e8137b13455713cc8f483918fc7e10bf99363b9ffd51a3f5ce62854baa532a24c9b957a911410566b74279e80e7d6fd8bbb543a56a4e76
7
+ data.tar.gz: c245d054577a989dd095d7d334b0c6ca29407d09c650b876371b98bca249ddebe102602eee505a98e8d602c2d0dd6415a5ed4b97ef7743c2ac6e82dc97a92c55
data/Gemfile CHANGED
@@ -3,8 +3,8 @@ source 'http://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  group :test do
6
- gem 'rails', '~> 3.2.12'
6
+ gem 'rails', '~> 3.2'
7
7
  gem 'sqlite3', '~> 1.3.7'
8
8
  gem 'rspec-rails', '~> 2.14'
9
9
  gem 'database_cleaner', '~> 1.0.1'
10
- end
10
+ end
@@ -3,11 +3,10 @@ class MenuItem < ActiveRecord::Base
3
3
  include Lolita::Menu::NestedTree
4
4
  self.table_name = 'lolita_menu_items'
5
5
 
6
- belongs_to :menu, :class_name => "Menu"
7
- attr_accessible :lft, :rgt, :depth, :parent_id, :menu_id, :url, :name
6
+ belongs_to :menu, :class_name => "Menu", touch: true
8
7
 
9
8
  validates :name,:presence => true
10
- validates :url, :format => {:with => /^(\/)|(http).*/}, :unless=>:root?
9
+ validates :url, :format => { :with => /\A(\/)|(http).*/ }, :unless=>:root?
11
10
 
12
11
  before_save :normalize_url
13
12
 
@@ -0,0 +1,24 @@
1
+ en:
2
+ lolita:
3
+ menu:
4
+ notice: "Menu saved."
5
+ error: "Couldn't save a menu. Try again."
6
+ "branch created": "New menu item created."
7
+ "branch deleted": "Menu item deleted."
8
+ add_new: "Add new"
9
+ save_menu: "Save menu"
10
+ nested_tree:
11
+ "branch created": "Barnch %{name} created."
12
+ "branch deleted": "%{name} deleted."
13
+ notice: "%{name} successfully saved."
14
+ error: "%{name} failed to save. Try again."
15
+ menu_item:
16
+ new: "Ny punkt"
17
+ activerecord:
18
+ models:
19
+ menu_item:
20
+ one: Menu item
21
+ other: Menus
22
+ menu:
23
+ one: Menu
24
+ other: Menus
@@ -111,7 +111,7 @@ module Lolita
111
111
  end
112
112
 
113
113
  def update_item(item)
114
- self.where(:id => item.value_for(:item_id)).update_all(item.attribute_value_pairs_hash)
114
+ self.where(:id => item.value_for(:item_id)).update_all(item.attribute_value_pairs_hash)
115
115
  end
116
116
 
117
117
  def remove_items(ids)
@@ -199,7 +199,7 @@ module Lolita
199
199
  self.class.lolita_nested_tree.scope_keys.inject({}) do |result, key|
200
200
  result[key] = self.send(key)
201
201
  result
202
- end
202
+ end
203
203
  end
204
204
 
205
205
  private
@@ -213,7 +213,7 @@ module Lolita
213
213
  end
214
214
 
215
215
  def am_i_new_root?
216
- #scope_ids.all? && scope_records.all? &&
216
+ #scope_ids.all? && scope_records.all? &&
217
217
  !(self.class.with_tree_scope(self) do
218
218
  root
219
219
  end)
@@ -230,11 +230,11 @@ module Lolita
230
230
  # scope.constantize.exists?(self.send(scope.foreign_key.to_sym))
231
231
  # end
232
232
  #end
233
-
233
+
234
234
  def put_in_place
235
235
  if place==:append
236
236
  item = self
237
- self.class.with_tree_scope(self) do
237
+ self.class.with_tree_scope(self) do
238
238
  root.append(item)
239
239
  end
240
240
  end
@@ -256,7 +256,7 @@ module Lolita
256
256
 
257
257
  def recalculate_positions_after(action)
258
258
  if action==:append
259
- self.class.update_all("rgt=#{self.rgt+2}","id=#{self.id}")
259
+ self.class.where(:id => self.id).update_all(:rgt=> self.rgt+2)
260
260
  end
261
261
  end
262
262
 
@@ -269,7 +269,7 @@ module Lolita
269
269
  }
270
270
  end
271
271
  end
272
-
272
+
273
273
  end
274
274
  end
275
275
  end
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "lolita-menu"
6
- s.version = "0.4.1"
6
+ s.version = "0.4.2"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.authors = ["ITHouse", "Arturs Meisters"]
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.require_paths = ["lib"]
19
19
  s.summary = "Menu managing plugin for Lolita."
20
20
 
21
- s.add_runtime_dependency(%q<lolita>, [">= 3.3.1", "~> 3.3"])
21
+ s.add_runtime_dependency(%q<lolita>, [">= 3.3"])
22
22
  s.files = `git ls-files`.split("\n")
23
23
  s.test_files = `git ls-files -- {test_orm,spec}/*`.split("\n")
24
24
  s.require_paths = ["lib"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lolita-menu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ITHouse
@@ -9,26 +9,20 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-02 00:00:00.000000000 Z
12
+ date: 2015-06-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: lolita
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - '>='
19
- - !ruby/object:Gem::Version
20
- version: 3.3.1
21
- - - ~>
18
+ - - ">="
22
19
  - !ruby/object:Gem::Version
23
20
  version: '3.3'
24
21
  type: :runtime
25
22
  prerelease: false
26
23
  version_requirements: !ruby/object:Gem::Requirement
27
24
  requirements:
28
- - - '>='
29
- - !ruby/object:Gem::Version
30
- version: 3.3.1
31
- - - ~>
25
+ - - ">="
32
26
  - !ruby/object:Gem::Version
33
27
  version: '3.3'
34
28
  description: Manage public menus for each project inside Lolita.
@@ -39,9 +33,9 @@ extra_rdoc_files:
39
33
  - LICENSE.txt
40
34
  - README.rdoc
41
35
  files:
42
- - .document
43
- - .gitignore
44
- - .rspec
36
+ - ".document"
37
+ - ".gitignore"
38
+ - ".rspec"
45
39
  - Gemfile
46
40
  - History.rdoc
47
41
  - LICENSE.txt
@@ -71,6 +65,7 @@ files:
71
65
  - app/views/components/lolita/menu_item/_display.html.haml
72
66
  - config/locales/en.yml
73
67
  - config/locales/lv.yml
68
+ - config/locales/sv_SE.yml
74
69
  - config/routes.rb
75
70
  - lib/generators/lolita/menu/install_generator.rb
76
71
  - lib/generators/lolita/menu/templates/lolita-menu-urls.rb
@@ -122,17 +117,17 @@ require_paths:
122
117
  - lib
123
118
  required_ruby_version: !ruby/object:Gem::Requirement
124
119
  requirements:
125
- - - '>='
120
+ - - ">="
126
121
  - !ruby/object:Gem::Version
127
122
  version: '0'
128
123
  required_rubygems_version: !ruby/object:Gem::Requirement
129
124
  requirements:
130
- - - '>='
125
+ - - ">="
131
126
  - !ruby/object:Gem::Version
132
127
  version: '0'
133
128
  requirements: []
134
129
  rubyforge_project:
135
- rubygems_version: 2.1.11
130
+ rubygems_version: 2.2.2
136
131
  signing_key:
137
132
  specification_version: 4
138
133
  summary: Menu managing plugin for Lolita.