Module: EffectivePosts
- Defined in:
- lib/effective_posts.rb,
lib/effective_posts/engine.rb,
lib/effective_posts/version.rb,
lib/generators/effective_posts/install_generator.rb
Defined Under Namespace
Modules: Generators Classes: Engine
Constant Summary collapse
- VERSION =
'0.5.8'.freeze
Class Method Summary collapse
- .authorized?(controller, action, resource) ⇒ Boolean
- .permitted_params ⇒ Object
- .setup {|_self| ... } ⇒ Object
Class Method Details
.authorized?(controller, action, resource) ⇒ Boolean
39 40 41 42 43 44 |
# File 'lib/effective_posts.rb', line 39 def self.(controller, action, resource) if .respond_to?(:call) || .kind_of?(Symbol) raise Effective::AccessDenied.new() unless (controller || self).instance_exec(controller, action, resource, &) end true end |
.permitted_params ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/effective_posts.rb', line 46 def self.permitted_params @@permitted_params ||= [ :title, :draft, :category, :published_at, :body, :tags, :extra, :start_at, :end_at, :location, :website_name, :website_href, (EffectiveAssets.permitted_params if defined?(EffectiveAssets)), roles: [] ].compact end |
.setup {|_self| ... } ⇒ Object
35 36 37 |
# File 'lib/effective_posts.rb', line 35 def self.setup yield self end |