Displaying 3 results from an estimated 3 matches for "stibr".
Did you mean:
stir
2011 Jan 15
3
has_many :through with Single Table inheritance
I have the following model structure setup.
class User < ActiveRecord::Base
end
class Parent < User
has_many :relationships
has_many :children,
:class_name => "Student",
:through => :relationships,
:conditions => "related_as = ''parent''"
end
class Student < User
has_many :relationships
2011 Jan 08
1
Paperclip custom Interpolation in url
Folks,
I have a simple model hierarchy (reduced to example as below)
class Post < ActiveRecord::Base
has_many :comments
end
class Comment < ActiveRecord::Base
belongs_to :post
has_attached_file :photo,
# :url => "/assets/class_cal/<original post
date>/:id/:style/:basename.:extension"
:url =>
2009 Apr 12
4
Can't get an Array function to be visible inside ApplicationHelper
Folks,
I seem to be missing something basic here.
I am trying to call a function from my application layout that will
return me a hash of the roles for the user currently signed in. Here
is the simplified code I have in ApplicationHelper module
class Array
def to_h
Hash[*enum_with_index.to_a.flatten]
end
end
def get_cur_user_roles
["school_admin",