Created
February 8, 2011 23:38
-
-
Save rramsden/817534 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Website < ActiveRecord::Base | |
has_many :redirects | |
end | |
class Redirect < ActiveRecord::Base | |
def self.factory_build(attributes) | |
# how do i access the primary_key of my Website | |
# when I call @website.redirects.factory_build(...) | |
end | |
end | |
class TemporaryRedirect < Redirect | |
def status | |
302 | |
end | |
end | |
class PermenantRedirect < Redirect | |
def status | |
301 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment