Sha256: 8fcacba6ecfec26d006635efcabde79e0d887145343c8a63632154b917d06ca0

Contents?: true

Size: 459 Bytes

Versions: 18

Compression:

Stored size: 459 Bytes

Contents

ActiveSupport.on_load(:active_record) do
  module ActiveRecord
    class Base
      def self.rails_admin(&block)
        RailsAdmin.config(self, &block)
      end

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

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

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rails_admin-2.3.1 config/initializers/active_record_extensions.rb
rails_admin-2.3.0 config/initializers/active_record_extensions.rb
rails_admin-2.2.1 config/initializers/active_record_extensions.rb
rails_admin-2.2.0 config/initializers/active_record_extensions.rb
rails_admin-2.1.1 config/initializers/active_record_extensions.rb
rails_admin-2.1.0 config/initializers/active_record_extensions.rb
rails_admin-2.0.2 config/initializers/active_record_extensions.rb
rails_admin-1.4.3 config/initializers/active_record_extensions.rb
rails_admin-2.0.1 config/initializers/active_record_extensions.rb
rails_admin-2.0.0 config/initializers/active_record_extensions.rb
rails_admin-2.0.0.rc config/initializers/active_record_extensions.rb
rails_admin-2.0.0.beta config/initializers/active_record_extensions.rb
rails_admin-1.4.2 config/initializers/active_record_extensions.rb
rails_admin-1.4.1 config/initializers/active_record_extensions.rb
rails_admin-1.4.0 config/initializers/active_record_extensions.rb
rails_admin-1.3.0 config/initializers/active_record_extensions.rb
rails_admin-1.2.0 config/initializers/active_record_extensions.rb
rails_admin-1.1.1 config/initializers/active_record_extensions.rb