module Hancock::RailsAdminSettingsPatch
Public Class Methods
manager_can_add_actions()
click to toggle source
def self.manager_can_default_actions
# [:index, :show, :read, :edit, :update] super - [:new, :create]
end def self.manager_can_default_actions
ret = [] # ret << :model_accesses if ::Hancock::Goto.config.user_abilities_support ret
end
# File lib/hancock/rails_admin_settings_patch.rb, line 54 def self.manager_can_add_actions ret = [] # ret << :model_accesses if defined?(::RailsAdminUserAbilities) ret += [:comments, :model_comments] if defined?(::RailsAdminComments) ret << :hancock_touch if defined?(::Hancock::Cache::Cacheable) ret.freeze end
manager_cannot_add_actions()
click to toggle source
# File lib/hancock/rails_admin_settings_patch.rb, line 61 def self.manager_cannot_add_actions [:new, :create, :delete, :destroy] end
rails_admin_add_visible_actions()
click to toggle source
# File lib/hancock/rails_admin_settings_patch.rb, line 65 def self.rails_admin_add_visible_actions ret = manager_can_actions.dup ret << :model_accesses if defined?(::RailsAdminUserAbilities) ret += [:comments, :model_comments] if defined?(::RailsAdminComments) ret << :hancock_touch if defined?(::Hancock::Cache::Cacheable) ret.freeze end
Public Instance Methods
blank?()
click to toggle source
Calls superclass method
# File lib/hancock/rails_admin_settings_patch.rb, line 37 def blank? if upload_kind? file.blank? else super end end
for_admin?()
click to toggle source
# File lib/hancock/rails_admin_settings_patch.rb, line 24 def for_admin? self.for_admin end
processed_value()
click to toggle source
Calls superclass method
# File lib/hancock/rails_admin_settings_patch.rb, line 34 def processed_value ((upload_kind? and !file.blank?) ? file.url : super) end
val()
click to toggle source
# File lib/hancock/rails_admin_settings_patch.rb, line 28 def val ((upload_kind? and !file.blank?) ? file.url : value) end
value()
click to toggle source
Calls superclass method
# File lib/hancock/rails_admin_settings_patch.rb, line 31 def value ((upload_kind? and !file.blank?) ? file.url : super) end