apneadiving / Google-Maps-for-Rails

Enables easy Google map + overlays creation in Ruby apps
https://apneadiving.github.io/
MIT License
2.26k stars 382 forks source link

how to check current state of process_geocoding? #374

Closed gosuto closed 10 years ago

gosuto commented 10 years ago

This is a followup to http://stackoverflow.com/questions/18903126/gmaps4rails-how-to-check-value-of-process-geocoding

How do I check the current state of process_geocoding (whether it is true or false)?

I know this is a question (and probably a fairly stupid question honestly) and not an issue but I wasn't getting any response over at SO so I thought I'd try here.

Thanks!

Ben

apneadiving commented 10 years ago

the boolean checker is meant to give you this information, see checker here: https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Model-Customization

gosuto commented 10 years ago

The "checker" only tells you if that particular record needs to be geocoded or not.

I want to know if process_geocoding is on or off (for the entire model).

Ben

apneadiving commented 10 years ago

see here: https://github.com/apneadiving/Google-Maps-for-Rails/blob/1.x/lib/gmaps4rails/acts_as_gmappable.rb#L25

gmaps4rails_options bears your solution

gosuto commented 10 years ago

It must just be a syntax issue . . . I know how to set process_geocoding to true or false, I just don't know how to query the current value. Sorry if I'm being dense.

apneadiving commented 10 years ago

your_object.gmaps4rails_options will give you the answer

gosuto commented 10 years ago

Heh, I was trying My_class.gmaps4rails_options which was throwing an error. Didn't occur to me to call gmaps4rails_options on the instance. Thanks!