Sha256: 6a993ba88d214a4318934c53af6ccea349e2596d09ab568a6db859c072fa883b

Contents?: true

Size: 456 Bytes

Versions: 11

Compression:

Stored size: 456 Bytes

Contents

if defined?(::ActiveRecord)
  module ActiveRecord
    class Base
      def self.rails_admin(&block)
        RailsAdmin.config(self, &block)
      end

      def rails_admin_default_object_label_method
        self.new_record? ? "new #{self.class}" : "#{self.class} ##{id}"
      end

      def safe_send(value)
        if self.has_attribute?(value)
          read_attribute(value)
        else
          send(value)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
rails_admin-1.0.0.rc config/initializers/active_record_extensions.rb
rails_admin-0.8.1 config/initializers/active_record_extensions.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/rails_admin-0.7.0/config/initializers/active_record_extensions.rb
rails_admin-0.7.0 config/initializers/active_record_extensions.rb
rails_admin-0.6.8 config/initializers/active_record_extensions.rb
rails_admin-0.6.7 config/initializers/active_record_extensions.rb
rails_admin-0.6.6 config/initializers/active_record_extensions.rb
rails_admin-0.6.5 config/initializers/active_record_extensions.rb
rails_admin-0.6.4 config/initializers/active_record_extensions.rb
rails_admin-0.6.3 config/initializers/active_record_extensions.rb
rails_admin-0.6.2 config/initializers/active_record_extensions.rb