On Wed, Nov 4, 2009 at 9:13 AM, Matteo Vaccari wrote:
>
> It all began when a collegue said that "our free text search throws if the
> user enters something with a dot". A bit of investigation showed that
> ActiveRecord produced a different set of queries depending on the user input
> containing
It all began when a collegue said that "our free text search throws if the
user enters something with a dot". A bit of investigation showed that
ActiveRecord produced a different set of queries depending on the user input
containing a dot or not. The :include is handled with a single query with a
Done. I've created the ticket and enclosed a patch here:
https://rails.lighthouseapp.com/projects/16213-rails-guides/tickets/105-activesupportorderedhashreplace-results-in-corrupt-keys
Turns out the problem was more fundamental than just
OrderedHash#slice! -it's actually a problem in OrderedHash
Hi Rodrigo,
The boolean accessors on the User model could probably be refactored,
but you get the idea.
class User < ActiveRecord::Base
has_many :roles
def institution_admin?
roles.any? { |r| r.label == 'institution_admin' }
end
def system_admin?
roles.an
URL(ruby blog in 15 mins tutorial video) :
http://media.rubyonrails.org/video/rails_blog_2.mov
is down! I am a software engineer commited to get a taste of ruby on
rails and i found this tutorial yesterday, and today I cant view it
because the server is down, and it is not even saved in my browse
Hi Rodrigo,
Here is an example of what you probably want:
class User
has_many :roles
def institution_admin?
roles.any? { |r| r.label == 'institution_admin' }
end
def system_admin?
roles.any? { |r| r.label == 'system_admin' }
end
end
class InstitutionContr