Sha256: f997c7055558e5579a678b0ef45a2d17bb396eac58fc6d00cf6248a714c1fde8

Contents?: true

Size: 1.01 KB

Versions: 6

Compression:

Stored size: 1.01 KB

Contents

module AdminData::Chelper

  def per_page
    AdminData::Config.setting[:will_paginate_per_page]
  end

  def admin_data_is_allowed_to_view?
    return true if Rails.env.development?
    AdminData::Config.setting[:is_allowed_to_view].call(self)
  end

  def admin_data_is_allowed_to_view_klass?
    return true if Rails.env.development?
    AdminData::Config.setting[:is_allowed_to_view_klass].call(self)
  end

  def admin_data_is_allowed_to_update?
    return true if Rails.env.development?
    AdminData::Config.setting[:is_allowed_to_update].call(self)
  end

  def admin_data_is_allowed_to_update_model?
    return true if Rails.env.development?
    AdminData::Config.setting[:is_allowed_to_update_model].call(self)
  end

  def admin_data_invalid_record_link(klassu, id, error)
    record = klassu.camelize.constantize.send(:find, id)
    tmp = admin_data_on_k_path(:klass => klasss.underscore, :id => record)
    a = []
    a << link_to(klasss, tmp, :target => '_blank')
    a << id
    a << error
    a.join(' | ')
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
admin_data-1.0.8 lib/admin_data/chelper.rb
admin_data-1.0.7 lib/admin_data/chelper.rb
admin_data-1.0.6 lib/admin_data/chelper.rb
admin_data-1.0.5 lib/admin_data/chelper.rb
admin_data-1.0.4 lib/admin_data/chelper.rb
admin_data-1.0.3 lib/admin_data/chelper.rb