Skip to content

Commit

Permalink
Merge branch 'master' of github.com:fatfreecrm/fat_free_crm
Browse files Browse the repository at this point in the history
  • Loading branch information
ndbroadbent committed Dec 14, 2011
2 parents b51dff4 + 8e057c9 commit a3b6997
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/fields/field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ def column_type(field_type = self.as)
def input_options
input_html = {:maxlength => attributes[:maxlength]}

attributes.select { |k,v|
%w(as collection disabled label placeholder required).include?(k)
attributes.reject { |k,v|
!%w(as collection disabled label placeholder required).include?(k)
}.symbolize_keys.merge(:input_html => input_html)
end

Expand Down
4 changes: 4 additions & 0 deletions spec/models/field_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@
)
end


it "should return a list of field types" do
Field.field_types['string'].should == {:type => :string, :options => nil}
end

it "should return a hash of input options" do
Field.new.input_options.should be_a(Hash)
end

it "should be able to display a empty multi_select value" do
field = Field.new(
Expand Down

0 comments on commit a3b6997

Please sign in to comment.