-
-
Save ratnikov/780015 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Admin::AuditsController < ApplicationController | |
| def create | |
| @audit = Audit.new params[:audit] | |
| if @audit.valid? | |
| # ... | |
| else | |
| render :action => 'new' | |
| end | |
| end | |
| end |
This file contains hidden or 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 Audit < ActiveRecord::RecordWithoutBase | |
| validates_format_of :start_date, :with => ... | |
| validates_format_of :end_date, :with => ... | |
| def versions | |
| accounts= Account.with_role(Role.find_by_name("admin")) | |
| VestalVersions::Version.order("created_at desc").where(:user_id => accounts, :created_at => start_date..end_date) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment