Module: Osgb::ClassMethods
- Defined in:
- lib/osgb/has_gridref.rb
Instance Method Summary collapse
Instance Method Details
#has_gridref(name, options = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/osgb/has_gridref.rb', line 13 def has_gridref name, = {} include Osgb::InstanceMethods self. = { :lat => 'lat', :lng => 'lng', :gridref => 'gridref', :validation => false, :conversion => true }.merge() before_validation :convert_between_gridref_and_latlng if [:conversion] validates :must_have_location if [:validation] end |