Inheritance
Polymorphism
Abstraction
Encapsulation
Tuesday, December 24, 2013
Friday, December 13, 2013
Rails - Define class method in module file
module PicturePartials
module Cse
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
def find_by_picture_id(picture_id)
Picture.joins(:picture).where('picture_id = ?', picture_id).first
end
end
end
end
module Cse
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
def find_by_picture_id(picture_id)
Picture.joins(:picture).where('picture_id = ?', picture_id).first
end
end
end
end
Subscribe to:
Posts (Atom)