Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Mongoid Hash type should be represented as text

  • Loading branch information...
commit 1075d684b4912d60c073db0182cbecdadef39832 1 parent 7749ecd
@mshibuya authored
View
2  lib/rails_admin/adapters/mongoid.rb
@@ -95,7 +95,7 @@ def properties
"Date" => { :type => :date, :length => nil },
"DateTime" => { :type => :datetime, :length => nil },
"Float" => { :type => :float, :length => nil },
- "Hash" => { :type => :string, :length => nil },
+ "Hash" => { :type => :text, :length => nil },
"Integer" => { :type => :integer, :length => nil },
"Time" => { :type => :datetime, :length => nil },
"Object" => { :type => :bson_object_id, :length => nil },
View
4 lib/rails_admin/adapters/mongoid/abstract_object.rb
@@ -7,7 +7,7 @@ def initialize(object)
super
object.associations.each do |name, association|
if association.macro == :references_many
- instance_eval(<<EOS)
+ instance_eval <<-RUBY, __FILE__, __LINE__ + 1
def #{name.to_s.singularize}_ids
#{name}.map{|item| item.id }
end
@@ -17,7 +17,7 @@ def #{name.to_s.singularize}_ids=(items)
map{|item_id| self.#{name}.klass.find(item_id) rescue nil }.
compact
end
-EOS
+RUBY
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.