Created
October 2, 2015 16:08
-
-
Save nomasprime/8e4aa3bfcbbc7c1ba31d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AdminBound < ActiveRecord::Base | |
scope :sites, -> { | |
where(arel_table[:iso].eq('BRA').and(Arel::Nodes::NamedFunction.new('st_contains', [arel_table[:geom], Site.arel_table[:lonlat]]))).project(Site.arel_table[Arel.star]) | |
} | |
end |
smathy
commented
Oct 2, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment