This file contains hidden or 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
| define_index do | |
| indexes firstname, :sortable => true | |
| indexes lastname, :sortable => true | |
| has girls_sizes(:id), :as => :girls_size_ids | |
| has boys_sizes(:id), :as => :boys_size_ids | |
| has created_at | |
| where "users.state = 'active'" |
This file contains hidden or 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
| has_many :recent_kids_packages, :conditions => ["packages.created_at > ?",6.months.ago], :class_name => "Package", :foreign_key => "parent_id" | |
| has_many :girls_sizes, :source => :size, :through => :recent_kids_packages, :conditions => {"packages.gender" => 'girls'}, :foreign_key => "size_id" | |
| has_many :boys_sizes, :source => :size, :through => :recent_kids_packages, :conditions => {"packages.gender" => 'boys'}, :foreign_key => "size_id" |
This file contains hidden or 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
| # User | |
| has_many :packages | |
| # Package | |
| gender:string | |
| belongs_to :size, :class_name => "Size" |
This file contains hidden or 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
| $(document).click(function(ev){ | |
| if($(ev.target).hasClass("some-color-class")){ | |
| // do something | |
| } | |
| }); |