Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a rails toggle class in order to make mongodb work
- Loading branch information
Showing
10 changed files
with
80 additions
and
49 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,26 @@ | ||
module Impressionist | ||
# Responsability | ||
# Toggles between rails > 3.1 < 4 | ||
# In order to make attr_accessible available in a rails app < 4 | ||
class RailsToggle | ||
|
||
attr_reader :r_version | ||
|
||
def initialize(version) | ||
@r_version = version.to_s | ||
end | ||
|
||
# if Rails 4, it does not include attr_accessible | ||
# and it returns false | ||
def valid? | ||
greater_than_4? ? false : true | ||
end | ||
|
||
private | ||
|
||
def greater_than_4? | ||
r_version == "4" ? true : false | ||
end | ||
|
||
end | ||
end |
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
Binary file not shown.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
$:.unshift(File.dirname __FILE__) | ||
|
||
require "minitest/autorun" | ||
require "minitest/pride" |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
# Use this hook to configure impressionist parameters | ||
Impressionist.setup do |config| | ||
# Define ORM. Could be :active_record (default) and :mongo_mapper | ||
# config.orm = :active_record | ||
end | ||
# Define ORM. Could be :active_record (default) and :mongo_mapper | ||
#Impressionist.config.orm = :mongoid |