padrino-admin 0.13.3 → 0.13.3.1

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: 1cd122df97a418952e33fc80320f6dd0371200d5
4
- data.tar.gz: 31ad46248b46636ffad8d5153c9a9cceaa09df2d
3
+ metadata.gz: fa474f8dcdea67e42c27d492bc59ca8cd42c82bb
4
+ data.tar.gz: 619ebc7e29ffa95e9e2c66106f629b6caeb923e8
5
5
  SHA512:
6
- metadata.gz: d94c406691ca33465ae8a05e806ed7a33136f6235fcf0eaf3fe89b535995758039087c7564a76ec6e70fb691d43ced205ff8818b3c91c3313ed4add6b28b82f6
7
- data.tar.gz: 4d9f3107020b865b41874a8206ace887db9a8acd9bd212be221eca73cb399078ee3395de77a91ec17e118b774214d422c96ad0b14fa548a29e326eb7584d92ad
6
+ metadata.gz: 721bf7cb6d4b29e1e9522d9e04daac935c8156be2f72c7807772a126b7f98b99735fed99751eb62d73e234fc6c453a6dfed1588f66d1e001e382ddb4e4e0ed59
7
+ data.tar.gz: 4f0df29341af0de6b4a9f564dc18d9e7fadda23b41e77dbe4451ebbfdb5d528354d2ffd21970dcdfa07b9c4fd5da6a7b019b07525df75c6f8a2253ee5b75dc3b
data/lib/padrino-admin.rb CHANGED
@@ -1,4 +1,3 @@
1
- require 'active_support/core_ext/object/blank'
2
1
  require 'padrino-core'
3
2
  require 'padrino-helpers'
4
3
 
@@ -104,7 +104,7 @@ module Padrino
104
104
  # = link_to 'Profile', url(:accounts, :edit, :id => current_account.id)
105
105
  #
106
106
  def allowed?(account=nil, path=nil)
107
- path = "/" if path.blank?
107
+ path = "/" if path.nil? || path.empty?
108
108
  role = account.role.to_sym rescue nil
109
109
  authorizations = @authorizations.find_all { |auth| auth.roles.include?(:any) }
110
110
  allowed_paths = authorizations.map(&:allowed).flatten.uniq
@@ -135,6 +135,8 @@ module Padrino
135
135
  require_dependencies('bcrypt')
136
136
  end
137
137
 
138
+ require_dependencies 'activesupport', :version => ">= 3.1"
139
+
138
140
  # A nicer select box.
139
141
  # TODO FIXME This doesn't make much sense in here. Review.
140
142
  # gsub_file destination_root("admin/views/#{@model_plural}/_form.#{ext}"), "f.text_field :role, :class => :text_field", "f.select :role, :options => access_control.roles"
@@ -1,3 +1,5 @@
1
+ require 'active_support/core_ext/object/blank'
2
+
1
3
  module <%= @app_name %>
2
4
  class <%= @admin_name %> < Padrino::Application
3
5
  register Padrino::Mailer
@@ -78,7 +78,7 @@ module Padrino
78
78
  private
79
79
 
80
80
  def access_denied
81
- if login_page.present?
81
+ if login_page
82
82
  redirect url(login_page)
83
83
  else
84
84
  halt 401, "You don't have permission for this resource"
data/test/test_locale.rb CHANGED
@@ -6,20 +6,20 @@ describe "Filters" do
6
6
  it "should have a vaild #{name} locale for admin" do
7
7
  base = YAML.load_file(file)
8
8
  base = base[name]['padrino']['admin']
9
- assert base.present?
10
- assert base['save'].present?
11
- assert base['cancel'].present?
12
- assert base['list'].present?
13
- assert base['edit'].present?
14
- assert base['new'].present?
15
- assert base['show'].present?
16
- assert base['delete'].present?
17
- assert base['confirm'].present?
18
- assert base['created_at'].present?
19
- assert base['all'].present?
20
- assert base['profile'].present?
21
- assert base['settings'].present?
22
- assert base['logout'].present?
9
+ assert base
10
+ assert base['save']
11
+ assert base['cancel']
12
+ assert base['list']
13
+ assert base['edit']
14
+ assert base['new']
15
+ assert base['show']
16
+ assert base['delete']
17
+ assert base['confirm']
18
+ assert base['created_at']
19
+ assert base['all']
20
+ assert base['profile']
21
+ assert base['settings']
22
+ assert base['logout']
23
23
  end
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padrino-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.3
4
+ version: 0.13.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Padrino Team
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-08-17 00:00:00.000000000 Z
14
+ date: 2016-08-30 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: padrino-core
@@ -19,28 +19,28 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 0.13.3
22
+ version: 0.13.3.1
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 0.13.3
29
+ version: 0.13.3.1
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: padrino-helpers
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
34
  - - '='
35
35
  - !ruby/object:Gem::Version
36
- version: 0.13.3
36
+ version: 0.13.3.1
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - '='
42
42
  - !ruby/object:Gem::Version
43
- version: 0.13.3
43
+ version: 0.13.3.1
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: therubyracer
46
46
  requirement: !ruby/object:Gem::Requirement
@@ -291,7 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
291
291
  version: 1.3.6
292
292
  requirements: []
293
293
  rubyforge_project: padrino-admin
294
- rubygems_version: 2.6.4
294
+ rubygems_version: 2.5.1
295
295
  signing_key:
296
296
  specification_version: 4
297
297
  summary: Admin Dashboard for Padrino