inline_forms 1.4.9 → 1.5.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.
data/bin/inline_forms CHANGED
@@ -120,11 +120,11 @@ module InlineForms
120
120
  gem 'will_paginate', :git => 'git://github.com/acesuares/will_paginate.git'
121
121
  gem 'tabs_on_rails' # , :git => 'git://github.com/acesuares/tabs_on_rails.git', :branch => 'add_remote'
122
122
  gem 'ckeditor', :git => 'git://github.com/acesuares/ckeditor.git', :branch => 'master'
123
+ gem 'cancan', :git => 'git://github.com/acesuares/cancan.git', :branch => '2.0'
123
124
  gem 'carrierwave'
124
125
  gem 'remotipart', '~> 1.0'
125
126
  gem 'paper_trail'
126
127
  gem 'devise'
127
- gem 'cancan'
128
128
  gem 'inline_forms'
129
129
  gem 'validation_hints'
130
130
  gem 'mini_magick'
@@ -345,10 +345,10 @@ module InlineForms
345
345
  create_file "#{app_name}/app/helpers/application_helper.rb", <<-END_APPHELPER.strip_heredoc_with_indent
346
346
  module ApplicationHelper
347
347
  def application_name
348
- #{app_name}
348
+ '#{app_name}'
349
349
  end
350
350
  def application_title
351
- #{app_name}
351
+ '#{app_name}'
352
352
  end
353
353
  end
354
354
  END_APPHELPER
@@ -359,19 +359,19 @@ module InlineForms
359
359
  class ApplicationController < InlineFormsApplicationController
360
360
  protect_from_forgery
361
361
 
362
- # Uncomment next two lines if you want Devise authentication
362
+ # Comment next two lines if you don't want Devise authentication
363
363
  before_filter :authenticate_user!
364
364
  layout 'devise' if :devise_controller?
365
365
 
366
- # Uncomment next 6 lines if you want CanCan authorization
367
- # check_authorization :unless => :devise_controller?
368
- #
369
- # rescue_from CanCan::AccessDenied do |exception|
370
- # sign_out :user if user_signed_in?
371
- # redirect_to new_user_session_path, :alert => exception.message
372
- # end
366
+ # Comment next 6 lines if you want CanCan authorization
367
+ check_authorization :unless => :devise_controller?
368
+
369
+ rescue_from CanCan::AccessDenied do |exception|
370
+ sign_out :user if user_signed_in?
371
+ redirect_to new_user_session_path, :alert => exception.message
372
+ end
373
373
 
374
- # Uncomment next line if you want I18n
374
+ # Uncomment next line if you want I18n (based on subdomain)
375
375
  # before_filter :set_locale
376
376
 
377
377
  # Uncomment next line and specify default locale
@@ -393,6 +393,25 @@ module InlineForms
393
393
  end
394
394
  END_APPCONTROLLER
395
395
 
396
+ say "- Creating Ability model so that the user with id = 1 can access all..."
397
+ create_file "#{app_name}/app/models/ability.rb", <<-END_ABILITY.strip_heredoc_with_indent
398
+ class Ability
399
+ include CanCan::Ability
400
+
401
+ def initialize(user)
402
+ # See the wiki for details: https://github.com/ryanb/cancan/wiki/Defining-Abilities
403
+
404
+ user ||= user.new # guest user
405
+
406
+ if user.id == 1 #quick hack
407
+ can :access, :all
408
+ else
409
+ # put restrictions for other users here
410
+ end
411
+ end
412
+ end
413
+ END_ABILITY
414
+
396
415
  # create environments/production.rb if it's a dry run
397
416
  create_file "#{app_name}/config/environments/production.rb", " # config.assets.precompile += %w( search.js )\nend\n" if dry_run?
398
417
 
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module InlineForms
3
- VERSION = "1.4.9"
3
+ VERSION = "1.5.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inline_forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.9
4
+ version: 1.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-31 00:00:00.000000000 Z
12
+ date: 2012-08-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rvm