Skip to content

Commit a255544

Browse files
author
Janusz Mordarski
committed
Use Ruby 1.9+ syntax for hash literals
1 parent c32709f commit a255544

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/active_record/connection_adapters/mysql2spatial_adapter/column_methods.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module ConnectionAdapters
33
module Mysql2SpatialAdapter
44
module ColumnMethods
55
def spatial(name, options = {})
6-
raise "You must set a type. For example: 't.spatial type: :point'" unless options[:limit][:type]
6+
raise "You must set a type. For example: 't.spatial limit: { type: 'point' }'" unless options[:limit][:type]
77
column(name, options[:limit][:type], options)
88
end
99

lib/active_record/connection_adapters/mysql2spatial_adapter/main_adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ module Mysql2SpatialAdapter
4646
class MainAdapter < ConnectionAdapters::Mysql2Adapter
4747

4848

49-
NATIVE_DATABASE_TYPES = Mysql2Adapter::NATIVE_DATABASE_TYPES.merge(:spatial => {:name => "geometry"})
49+
NATIVE_DATABASE_TYPES = Mysql2Adapter::NATIVE_DATABASE_TYPES.merge(spatial: { name: 'geometry' })
5050

5151

5252
def initialize(*args_)

lib/active_record/connection_adapters/mysql2spatial_adapter/spatial_column.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def initialize(factory_settings_, table_name_, name_, default_, sql_type_=nil, n
6060
super(name_, default_,sql_type_, null_)
6161
@geometric_type = ::RGeo::ActiveRecord.geometric_type_from_name(sql_type_)
6262
if type == :spatial
63-
@limit = {:type => @geometric_type.type_name.underscore}
63+
@limit = { type: @geometric_type.type_name.underscore }
6464
end
6565
FACTORY_SETTINGS_CACHE[factory_settings_.object_id] = factory_settings_
6666
end

0 commit comments

Comments
 (0)