On 13 July 2015 at 19:20, tamouse pontiki wrote:
> A quick correction on Colin's suggestion:
>
> On Mon, Jul 13, 2015 at 2:44 AM, Colin Law wrote:
>>
>> On 13 July 2015 at 01:10, j...@via.net wrote:
>> > class Asset < ActiveRecord::Base
>> > belongs_to :site
>> >
>> > # class variable :name
A quick correction on Colin's suggestion:
On Mon, Jul 13, 2015 at 2:44 AM, Colin Law wrote:
> On 13 July 2015 at 01:10, j...@via.net wrote:
> > class Asset < ActiveRecord::Base
> > belongs_to :site
> >
> > # class variable :name
> >
> > end
> >
> > class Site < ActiveRecord::Base
> > has_
On 13 July 2015 at 01:10, j...@via.net wrote:
> class Asset < ActiveRecord::Base
> belongs_to :site
>
> # class variable :name
>
> end
>
> class Site < ActiveRecord::Base
> has_many :assets
>
> # class var x, y, z
>
> end
>
> Is there a dynamic finder that will traverse the inner join:
>
>
Ransack
https://github.com/activerecord-hackery/ransack
Seems like a promising for your usecase. Take a look at it.
On Mon, Jul 13, 2015 at 5:40 AM, j...@via.net wrote:
> class Asset < ActiveRecord::Base
> belongs_to :site
>
> # class variable :name
>
> end
>
> class Site < ActiveRecord::B
class Asset < ActiveRecord::Base
belongs_to :site
# class variable :name
end
class Site < ActiveRecord::Base
has_many :assets
# class var x, y, z
end
Is there a dynamic finder that will traverse the inner join:
e.g. Site.find_by_asset_name("xyzzy")
Can I get a list of sites where as
Hi...I am only 1 day into Rails, so please forgive me if this is a
lame question!
I have the following models:
require 'books_projects.rb'
class Project < ActiveRecord::Base
has_many :book_to_projects
has_many :books, :through => :book_to_projects
end
require 'books_projects.rb'
class Book
I have three models, Question, Response and User
User has many question, :through Responses
My response table has 3 main columns response, question_id and
user_id.
The use case is lets say the user can respond to 100 question, but
during a session he responds to 20. How do I find out the ones he
I'm not quite sure how to get at this data using Actrive record.. I'm trying
to get all the appointments made for a particular project. I'm using four
models, Projects, Tasks, Resources and Appointments.
The SQL gets me what I'm looking for but how do I do it using Active Record?
Select a.* f
8 matches
Mail list logo