-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurable search scope name #71
Conversation
@@ -12,7 +12,8 @@ module ClassMethods | |||
def initialize_scopes | |||
scope :are_from, lambda { |*args| where(:sent_messageable_id => args.first, :sent_messageable_type => args.first.class.name) } | |||
scope :are_to, lambda { |*args| where(:received_messageable_id => args.first, :received_messageable_type => args.first.class.name) } | |||
scope :search, lambda { |*args| where("body like :search_txt or topic like :search_txt",:search_txt => "%#{args.first}%")} | |||
scope ActsAsMessageable.search_scope_name, | |||
lambda { |*args| where("body like :search_txt or topic like :search_txt",:search_txt => "%#{args.first}%")} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [142/80]
Align the parameters of a method call if they span more than one line.
Use the new Ruby 1.9 hash syntax.
Space missing after comma.
Space missing inside }.
Addresses #62 |
scope :search, lambda { |*args| where("body like :search_txt or topic like :search_txt",:search_txt => "%#{args.first}%")} | ||
scope :connected_with, lambda { |*args| where("(sent_messageable_type = :sent_type and | ||
scope ActsAsMessageable.search_scope_name, | ||
lambda { |*args| where("body like :search_txt or topic like :search_txt", :search_txt => "%#{args.first}%") } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [143/80]
Align the parameters of a method call if they span more than one line.
Use the new Ruby 1.9 hash syntax.
Looks like it's still failing. Some pointers or comments on how to improve would be welcome |
Add configuration scope name for search to avoid naming conflict