effective_assets 1.7.7 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc978e19c2644aa55f3f5ddef384da495141bbf2
4
- data.tar.gz: 97c5c56905aca60f285e34d9bfd5c98ec3caa013
3
+ metadata.gz: 575677689fd92da51a47d0a77ea28c98bb903ca1
4
+ data.tar.gz: bcd980940b7e926a86de5f427553a45dde5a4010
5
5
  SHA512:
6
- metadata.gz: 6bb9afcb5b18825bd704bb76414436d24e04567b158e3c723c0e7e83f72da525f78ab5dc9cb054691c6077f4f0363a7289da20510be81d9d38f8c77027a09349
7
- data.tar.gz: c1abc5afb4d8594b6168436b78b4a160cf951b4bb924eea427872ed713c6a8b23b5bc59dae32148358b544e13ba2bc4ee4c21dcf1f8b0bd425045f4b2d828d14
6
+ metadata.gz: 201889c758244e264caf67a5fb3b729e7f8f0466f8f059bd23d5ce84f9146bb231e4bdb3c556cbbee386f79a9bb630f120e3a106f2898d7f796988c1da776228
7
+ data.tar.gz: 63c9008b994f8920de7607fc56e43b9b4e0e0b3faa711ffd4188f4d76fc632f12d09baac616c32ace52d629638c46e576fd48309302c500e788d0af8cf110afb
data/README.md CHANGED
@@ -457,6 +457,12 @@ To allow user uploads, using Cancan:
457
457
  can [:create, :update, :destroy], Effective::Asset, :user_id => user.id
458
458
  ```
459
459
 
460
+ To allow a user to see the admin / active_admin area:
461
+
462
+ ```ruby
463
+ can :admin, :effective_assets
464
+ ```
465
+
460
466
 
461
467
  ## Rake Tasks
462
468
 
@@ -517,8 +523,6 @@ rake jobs:clear
517
523
 
518
524
  MIT License. Copyright [Code and Effect Inc.](http://www.codeandeffect.com/)
519
525
 
520
- Code and Effect is the product arm of [AgileStyle](http://www.agilestyle.com/), an Edmonton-based shop that specializes in building custom web applications with Ruby on Rails.
521
-
522
526
 
523
527
  ## Credits
524
528
 
@@ -1,6 +1,9 @@
1
1
  if defined?(ActiveAdmin)
2
2
  ActiveAdmin.register Effective::Asset do
3
- menu :label => "Assets", :if => proc { EffectiveAssets.authorized?(controller, :manage, Effective::Asset.new()) rescue false }
3
+ menu :label => "Assets", :if => proc {
4
+ (EffectiveAssets.authorized?(controller, :manage, Effective::Asset.new()) rescue false) &&
5
+ (EffectiveAssets.authorized?(controller, :admin, :effective_assets) rescue false)
6
+ }
4
7
 
5
8
  filter :title
6
9
  filter :content_type
@@ -1,5 +1,3 @@
1
- # EffectiveAssets Rails Engine
2
-
3
1
  EffectiveAssets.setup do |config|
4
2
  config.assets_table_name = :assets
5
3
  config.attachments_table_name = :attachments
@@ -25,7 +23,7 @@ EffectiveAssets.setup do |config|
25
23
  #
26
24
  # Or disable the check completely:
27
25
  # config.authorization_method = false
28
- config.authorization_method = Proc.new { |controller, action, resource| true } # All users can see every screen
26
+ config.authorization_method = Proc.new { |controller, action, resource| authorize!(action, resource) } # CanCanCan
29
27
 
30
28
  # This is your S3 bucket information
31
29
  config.aws_bucket = ''
@@ -27,7 +27,7 @@ module EffectiveAssets
27
27
 
28
28
  # Set up our default configuration options.
29
29
  initializer "effective_assets.defaults", :before => :load_config_initializers do |app|
30
- eval File.read("#{config.root}/lib/generators/templates/effective_assets.rb")
30
+ eval File.read("#{config.root}/config/effective_assets.rb")
31
31
  end
32
32
 
33
33
  initializer "effective_assets.append_precompiled_assets" do |app|
@@ -1,3 +1,3 @@
1
1
  module EffectiveAssets
2
- VERSION = '1.7.7'.freeze
2
+ VERSION = '1.8.0'.freeze
3
3
  end
@@ -3,9 +3,9 @@ module EffectiveAssets
3
3
  class InstallGenerator < Rails::Generators::Base
4
4
  include Rails::Generators::Migration
5
5
 
6
- desc "Creates an EffectiveAssets initializer in your application."
6
+ desc 'Creates an EffectiveAssets initializer in your application.'
7
7
 
8
- source_root File.expand_path("../../templates", __FILE__)
8
+ source_root File.expand_path('../../templates', __FILE__)
9
9
 
10
10
  def self.next_migration_number(dirname)
11
11
  if not ActiveRecord::Base.timestamped_migrations
@@ -16,25 +16,21 @@ module EffectiveAssets
16
16
  end
17
17
 
18
18
  def copy_initializer
19
- template "effective_assets.rb", "config/initializers/effective_assets.rb"
19
+ template ('../' * 3) + 'config/effective_assets.rb', 'config/initializers/effective_assets.rb'
20
20
  end
21
21
 
22
22
  def copy_uploader
23
- template "asset_uploader.rb", "app/uploaders/asset_uploader.rb"
23
+ template 'asset_uploader.rb', 'app/uploaders/asset_uploader.rb'
24
24
  end
25
25
 
26
26
  def create_migration_file
27
27
  @assets_table_name = ':' + EffectiveAssets.assets_table_name.to_s
28
28
  @attachments_table_name = ':' + EffectiveAssets.attachments_table_name.to_s
29
- migration_template '../../../db/migrate/01_create_effective_assets.rb.erb', 'db/migrate/create_effective_assets.rb'
29
+ migration_template ('../' * 3) + 'db/migrate/01_create_effective_assets.rb.erb', 'db/migrate/create_effective_assets.rb'
30
30
  end
31
31
 
32
32
  def install_delayed_jobs
33
- run "rails generate delayed_job:active_record"
34
- end
35
-
36
- def show_readme
37
- readme "README" if behavior == :invoke
33
+ run 'rails generate delayed_job:active_record'
38
34
  end
39
35
  end
40
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.7
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-24 00:00:00.000000000 Z
11
+ date: 2016-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -207,15 +207,14 @@ files:
207
207
  - app/views/effective/assets/iframe.html.haml
208
208
  - app/views/effective/snippets/_effective_asset.html.haml
209
209
  - app/views/effective/style_guide/_effective_assets.html.haml
210
+ - config/effective_assets.rb
210
211
  - config/routes.rb
211
212
  - db/migrate/01_create_effective_assets.rb.erb
212
213
  - lib/effective_assets.rb
213
214
  - lib/effective_assets/engine.rb
214
215
  - lib/effective_assets/version.rb
215
216
  - lib/generators/effective_assets/install_generator.rb
216
- - lib/generators/templates/README
217
217
  - lib/generators/templates/asset_uploader.rb
218
- - lib/generators/templates/effective_assets.rb
219
218
  - lib/tasks/effective_assets_tasks.rake
220
219
  homepage: https://github.com/code-and-effect/effective_assets
221
220
  licenses:
@@ -1 +0,0 @@
1
- Thanks for using EffectiveAssets