Search Results

Search found 3 results on 1 pages for 'pygmalion'.

Page 1/1 | 1 

  • Archiving an Entire Rails Site

    - by Pygmalion
    I have a Ruby on Rails site that was only needed for a short period of time during which users added various objects to a mySQL database, commenting on them, associating themselves with them, etc. etc. etc. The question is this: the site is no longer needed until a week next year around this time when I will clear the database and use it again (starting from scratch). What's the best way to archive the current site so that the existing content is still viewable but no new content can be added? By best way, I mean the method by which the least system resources will be used, the server will be the safest, etc. Any suggestions?

    Read the article

  • Using Rails Helper Methods within ActionRecord Queries?

    - by Pygmalion
    I have a table of events (in a sqlite3 database for what it's worth) with a column called "when" that contains a timestamp detailing precisely when the event that particular row denotes is set to occur. Right now, I have @events = Event.find(:all) in my controller and I am using template helper methods to calculate where to place each event on my display page based on the day of the week it occurs on. For example: <% if(event.when.wday == 6) %> # DO SOMETHING <% end %> I want to abstract this logic to the controller however. My idea was to do the following: @thursday_events = Event.find(:all, :conditions => ["when.wday=4"]) Obviously (I guess?) this didn't work. Throwing the error "SQLite3::SQLException: near "when": syntax error: SELECT * FROM "events" WHERE (when.wday=4)". I'm assuming this is because I tried to use a helper method within a find condition but I don't know a better way to do this. Any advice? Thanks!

    Read the article

  • Checking if a boolean column is true in MySQL/Rails

    - by Pygmalion
    Rails and MySQL: I have a table with several boolean columns representing tags. I want to find all the rows for which a specific one of these columns is 'true' (or I guess in the case of MySQL, '1'). I have the following code in my view. @tag = params[:tag] @supplies = Supply.find(:all, :conditions=>["? IS NOT NULL and ? !=''", @tag, @tag], :order=>'name') The @tag is being passed in from the url. Why is it then that I am instead getting all of my @supplies (i.e. every row) rather than just those that are true for the column for @tag. Thanks!

    Read the article

1