search for: zlx

Displaying 2 results from an estimated 2 matches for "zlx".

Did you mean: lx
2013 Jun 01
10
How about add a method to truncate a long text more smart?
...Model module. You can read more about Active Record in its README. to The Model layer represents your domain model (such as Account, Product, Person, Post, etc.) and encapsulates the business logic that is specific to your application. I create a method content_truncate <https://github.com/zlx/content-truncate> to implementation my requirement. But it is so immature for merge into activesupport So welcome advices -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving ema...
2013 Jun 15
1
A puzzle about default_scope
Hi, guys I have a puzzle about default_scope. Suppose I have two model: class User < ActiveRecord::Base has_many :blogs default_scope where(deleted_at: nil) end class Blog < ActiveRecord::Base belongs_to :user end I want to produce sqlselect blogs.* from blogs inner join users on users.id = blogs.user_id and users.deleted_at is null And the code Blog.joins(:user), which I think