20 Jun, 2015

1 commit

  •   scopes are defined as class methods on the singleton of the class they
      were named instead of the class that calls them, so regardless if they
      are called by Enterprise or Community, they were defined on
      Organization, so #visible_for_person() always gives us
        `WHERE "profiles"."type" IN ('Organization', 'Enterprise', 'Community')`
    
      This wouldn't be a problem if rails 3.2 didn't merge the WHERE clauses
      of nested scopes, which causes the previous filtering by type of
      Enterprise/Community to be thrown away in favor of the broader one.
    
      This was fixed in later rails versions but we want to be able to
      search only for Enterprises or Communities, so I translated the scope
      to a class method on the parent class Organization, so it can be
      inherited by the other.
    Larissa Reis
     

02 Jun, 2015

7 commits